工具发布流程和使用申请流程
This commit is contained in:
parent
2a75898712
commit
fbc96e81e3
6
pom.xml
6
pom.xml
@ -3,14 +3,14 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<groupId>com.rzdata</groupId>
|
||||
<artifactId>tool-tech</artifactId>
|
||||
<version>3.8.8</version>
|
||||
|
||||
<name>tool-tech</name>
|
||||
<description>工具与技术交流管理系统</description>
|
||||
|
||||
|
||||
<properties>
|
||||
<tool-tech.version>3.8.8</tool-tech.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@ -285,4 +285,4 @@
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -16,7 +16,26 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>21.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.76</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.blueland.bpmclient</groupId>
|
||||
<artifactId>workflow-sdk</artifactId>
|
||||
<version>0.1.5</version>
|
||||
</dependency>
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.rzdata</groupId>
|
||||
@ -85,17 +104,17 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -1,15 +1,22 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
import com.rzdata.common.enums.BizExceptionCodeEnum;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.exception.RestException;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import com.rzdata.web.service.IToolService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -30,6 +37,9 @@ public class ToolController extends BaseController
|
||||
@Autowired
|
||||
private IToolService toolService;
|
||||
|
||||
@Autowired
|
||||
private WorkflowService workflowService;
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*/
|
||||
@ -62,6 +72,21 @@ public class ToolController extends BaseController
|
||||
return success(toolService.selectToolByToolId(toolId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工具信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/bpmc/{bpmcId}")
|
||||
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
|
||||
{
|
||||
return success(toolService.getInfoByBpmcId(bpmcId));
|
||||
}
|
||||
|
||||
@ApiOperation("判断文件名称是否存在 true 存在 false 不存在")
|
||||
@GetMapping("/checkToolExist")
|
||||
public AjaxResult checkToolExist(Tool tTool) {
|
||||
return AjaxResult.success(toolService.checkToolExist(tTool.getToolCode(), tTool.getToolRespDept()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工具信息
|
||||
*/
|
||||
@ -69,17 +94,41 @@ public class ToolController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Tool tTool)
|
||||
{
|
||||
if(toolService.checkToolExist(tTool.getToolCode(), tTool.getToolRespDept())){
|
||||
throw new RestException(BizExceptionCodeEnum.A400001001.getCode(), BizExceptionCodeEnum.A400001001.getMessage());
|
||||
boolean add = false;
|
||||
if (StringUtils.isEmpty(tTool.getToolId())) {
|
||||
tTool.setToolId(IdUtil.simpleUUID());
|
||||
add = true;
|
||||
}
|
||||
ProcessInstanceModel processInstanceModel = null;
|
||||
try {
|
||||
if(StringUtils.equals(tTool.getRecordStatus(), RecordStatusEnum.DRAFT.getCode())){
|
||||
processInstanceModel = workflowService.saveExecute(tTool.getBpmClientInputModel(), tTool.getToolId());
|
||||
}else if (StringUtils.equals(tTool.getRecordStatus(), RecordStatusEnum.CANCEL.getCode())){
|
||||
processInstanceModel = workflowService.cancelExecute(tTool.getBpmClientInputModel(), tTool.getToolId());
|
||||
}else{
|
||||
processInstanceModel = workflowService.nextExecute(tTool.getBpmClientInputModel(), tTool.getToolId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (processInstanceModel!=null&&StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
|
||||
if (add) {
|
||||
tTool.setProcInstId(processInstanceModel.getProcInstId());
|
||||
toolService.insertTool(tTool);
|
||||
}else if (BooleanUtil.isTrue(tTool.getEditStatus())){
|
||||
toolService.updateTool(tTool);
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
return toAjax(toolService.insertTool(tTool));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工具信息
|
||||
*/
|
||||
@Log(title = "工具信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody Tool tTool)
|
||||
{
|
||||
return toAjax(toolService.updateTool(tTool));
|
||||
|
@ -0,0 +1,156 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.BooleanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.enums.RecordStatusEnum;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.web.service.IUseApplyItemService;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.service.IUseApplyService;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 使用申请Controller
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/use/apply")
|
||||
public class UseApplyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUseApplyService useApplyService;
|
||||
|
||||
@Autowired
|
||||
private WorkflowService workflowService;
|
||||
|
||||
@Autowired
|
||||
private IUseApplyItemService useApplyItemService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UseApply useApply)
|
||||
{
|
||||
startPage();
|
||||
List<UseApply> list = useApplyService.selectUseApplyList(useApply);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工具信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/bpmc/{bpmcId}")
|
||||
public AjaxResult getInfoByBpmcId(@PathVariable("bpmcId") String bpmcId)
|
||||
{
|
||||
return success(useApplyService.getInfoByBpmcId(bpmcId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出使用申请列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:export')")
|
||||
@Log(title = "使用申请", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, UseApply useApply)
|
||||
{
|
||||
List<UseApply> list = useApplyService.selectUseApplyList(useApply);
|
||||
ExcelUtil<UseApply> util = new ExcelUtil<UseApply>(UseApply.class);
|
||||
util.exportExcel(response, list, "使用申请数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取使用申请详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(useApplyService.selectUseApplyById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*/
|
||||
@Log(title = "使用申请", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UseApply useApply)
|
||||
{
|
||||
boolean add = false;
|
||||
if (StringUtils.isEmpty(useApply.getId())) {
|
||||
useApply.setId(IdUtil.simpleUUID());
|
||||
add = true;
|
||||
}
|
||||
ProcessInstanceModel processInstanceModel = null;
|
||||
try {
|
||||
if(StringUtils.equals(useApply.getRecordStatus(), RecordStatusEnum.DRAFT.getCode())){
|
||||
processInstanceModel = workflowService.saveExecute(useApply.getBpmClientInputModel(), useApply.getId());
|
||||
}else if (StringUtils.equals(useApply.getRecordStatus(), RecordStatusEnum.CANCEL.getCode())){
|
||||
processInstanceModel = workflowService.cancelExecute(useApply.getBpmClientInputModel(), useApply.getId());
|
||||
}else{
|
||||
processInstanceModel = workflowService.nextExecute(useApply.getBpmClientInputModel(), useApply.getId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (processInstanceModel!=null&&StringUtils.isNotEmpty(processInstanceModel.getProcInstId())) {
|
||||
if (add) {
|
||||
useApply.setProcInstId(processInstanceModel.getProcInstId());
|
||||
useApplyService.insertUseApply(useApply);
|
||||
useApplyItemService.updateItemList(useApply.getItemList(),useApply.getId());
|
||||
}else if (BooleanUtil.isTrue(useApply.getEditStatus())){
|
||||
useApplyService.updateUseApply(useApply);
|
||||
useApplyItemService.updateItemList(useApply.getItemList(),useApply.getId());
|
||||
}
|
||||
return AjaxResult.success("操作成功",processInstanceModel);
|
||||
}else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*/
|
||||
@Log(title = "使用申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody UseApply useApply)
|
||||
{
|
||||
return toAjax(useApplyService.updateUseApply(useApply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:apply:remove')")
|
||||
@Log(title = "使用申请", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(useApplyService.deleteUseApplyByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.web.domain.UseApplyItem;
|
||||
import com.rzdata.web.service.IUseApplyItemService;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 使用申请详情Controller
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/use/apply/item")
|
||||
public class UseApplyItemController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUseApplyItemService useApplyItemService;
|
||||
|
||||
/**
|
||||
* 查询使用申请详情列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:item:list')")
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page(UseApplyItem useApplyItem)
|
||||
{
|
||||
startPage();
|
||||
List<UseApplyItem> list = useApplyItemService.selectUseApplyItemList(useApplyItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(UseApplyItem useApplyItem)
|
||||
{
|
||||
return AjaxResult.success(useApplyItemService.selectUseApplyItemList(useApplyItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出使用申请详情列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:item:export')")
|
||||
@Log(title = "使用申请详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, UseApplyItem useApplyItem)
|
||||
{
|
||||
List<UseApplyItem> list = useApplyItemService.selectUseApplyItemList(useApplyItem);
|
||||
ExcelUtil<UseApplyItem> util = new ExcelUtil<UseApplyItem>(UseApplyItem.class);
|
||||
util.exportExcel(response, list, "使用申请详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取使用申请详情详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:item:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(useApplyItemService.selectUseApplyItemById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:item:add')")
|
||||
@Log(title = "使用申请详情", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UseApplyItem useApplyItem)
|
||||
{
|
||||
return toAjax(useApplyItemService.insertUseApplyItem(useApplyItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:item:edit')")
|
||||
@Log(title = "使用申请详情", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UseApplyItem useApplyItem)
|
||||
{
|
||||
return toAjax(useApplyItemService.updateUseApplyItem(useApplyItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:item:remove')")
|
||||
@Log(title = "使用申请详情", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(useApplyItemService.deleteUseApplyItemByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,619 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import com.blueland.bpmclient.model.*;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.core.domain.entity.SysUser;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.system.service.ISysConfigService;
|
||||
import com.rzdata.system.service.ISysUserService;
|
||||
import com.rzdata.web.core.config.BpmcConfig;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import com.rzdata.web.domain.vo.WorkFlowPageVo;
|
||||
import com.rzdata.web.service.WorkflowService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequestMapping(value = "/workflow")
|
||||
@Api(value = "流程服务", tags = {"流程服务"})
|
||||
public class WorkflowController extends BaseController {
|
||||
|
||||
private final WorkflowService workflowService;
|
||||
|
||||
private final ISysUserService userService;
|
||||
|
||||
private final ISysConfigService sysConfigService;
|
||||
|
||||
private final BpmcConfig bpmcConfig;
|
||||
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取流程待选人员展示方式", notes = "获取流程待选人员展示方式")
|
||||
@GetMapping(value = "selectUserStyle")
|
||||
@ResponseBody
|
||||
public AjaxResult selectUserStyle() throws Exception {
|
||||
String result = "tree";
|
||||
String value = this.sysConfigService.selectConfigByKey("DMS_FLOW_SELECT_USER_STYLE");
|
||||
if(StringUtils.isNotEmpty(value)) {
|
||||
result = value;
|
||||
}
|
||||
return AjaxResult.success("",result);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "根据流程定义Key获取流程定义信息", notes = "根据流程定义Key获取流程定义信息")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "procDefKey", value = "流程定义key", dataType = "string", paramType = "path") })
|
||||
@GetMapping(value = "process/key/{procDefKey}")
|
||||
@ResponseBody
|
||||
public AjaxResult getProcessDefinitionModel(@PathVariable("procDefKey") String procDefKey) throws Exception {
|
||||
ProcessDefinitionModel processDefinitionModel = workflowService.getProcessDefinitionModel(
|
||||
procDefKey);
|
||||
return AjaxResult.success(processDefinitionModel);
|
||||
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取流程第一个人工环节定义", notes = "获取流程第一个人工环节定义")
|
||||
@GetMapping(value = "startactdef/{procDefId}")
|
||||
@ResponseBody
|
||||
public AjaxResult getStartActdef(
|
||||
@PathVariable("procDefId") String procDefId) throws Exception{
|
||||
ActivityDefinitionModel activityDefinitionModel = workflowService.getStartactDef(procDefId);
|
||||
return AjaxResult.success(activityDefinitionModel);
|
||||
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "新建流程,获取下一环节流程定义信息", notes = "新建流程,获取下一环节流程定义信息")
|
||||
@PostMapping(value = "nextacts/new")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActsByNew(@RequestBody SearchQuery searchQuery) {
|
||||
List<ActivityDefinitionModel> list = workflowService.getNextActs(searchQuery);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一环节集合,并可以标识已办和自动将未办理环节优先排序
|
||||
*
|
||||
* @param searchQuery
|
||||
* @return
|
||||
*/
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "新建流程,获取下一环节流程定义信息", notes = "新建流程,获取下一环节流程定义信息")
|
||||
@PostMapping(value = "nextacts/new2")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActsByNew2(@RequestBody SearchQuery searchQuery) {
|
||||
List<ActivityDefinitionModel> list = workflowService.getNextActs(searchQuery);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "待办流程,获取下一环节流程定义信息", notes = "待办流程,获取下一环节流程定义信息")
|
||||
@PostMapping(value = "nextacts/pending")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActsByPending(@RequestBody SearchQuery searchQuery) {
|
||||
List<ActivityDefinitionModel> list = workflowService.getNextActs(searchQuery);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "新建流程,获取下一环节用户定义信息", notes = "新建流程,获取下一环节用户定义信息")
|
||||
@GetMapping(value = "nextactuser/new")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActUsersByNew(
|
||||
@RequestParam(value = "userOrgId") String userOrgId,
|
||||
@RequestParam(value = "curActDefId") String curActDefId,
|
||||
@RequestParam(value = "destActDefId") String destActDefId,
|
||||
@RequestParam(value = "procDefId") String procDefId, HttpServletRequest request) {
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(userOrgId);
|
||||
searchQuery.setCurActDefId(curActDefId);
|
||||
searchQuery.setDestActDefId(destActDefId);
|
||||
searchQuery.setProcDefId(procDefId);
|
||||
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
|
||||
return AjaxResult.success(rs);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "新建流程,获取下一环节用户定义信息", notes = "新建流程,获取下一环节用户定义信息")
|
||||
@PostMapping(value = "nextactuser/new")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActUsersByNew(
|
||||
@RequestParam(value = "userOrgId") String userOrgId,
|
||||
@RequestParam(value = "curActDefId") String curActDefId,
|
||||
@RequestParam(value = "destActDefId") String destActDefId,
|
||||
@RequestParam(value = "procDefId") String procDefId, @RequestBody SearchQuery searchQuery,
|
||||
HttpServletRequest request) {
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(userOrgId);
|
||||
searchQuery.setCurActDefId(curActDefId);
|
||||
searchQuery.setDestActDefId(destActDefId);
|
||||
searchQuery.setProcDefId(procDefId);
|
||||
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
|
||||
return AjaxResult.success(rs);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "待办流程,获取下一环节用户定义信息", notes = "待办流程,获取下一环节用户定义信息")
|
||||
@GetMapping(value = "nextactuser/pending")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActUsersByPending(
|
||||
@RequestParam(value = "userOrgId") String userOrgId,
|
||||
@RequestParam(value = "curActInstId") String curActInstId,
|
||||
@RequestParam(value = "destActDefId") String destActDefId,
|
||||
@RequestParam(value = "curActDefId") String curActDefId,
|
||||
@RequestParam(value = "procDefKey") String procDefKey,
|
||||
@RequestParam(value = "procInstId") String procInstId,
|
||||
|
||||
HttpServletRequest request) {
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setTenantId(bpmcConfig.getTenantId());
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(userOrgId);
|
||||
searchQuery.setDestActDefId(destActDefId);
|
||||
searchQuery.setCurActInstId(curActInstId);
|
||||
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
|
||||
return AjaxResult.success(rs);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "待办流程,获取下一环节用户定义信息", notes = "待办流程,获取下一环节用户定义信息")
|
||||
@PostMapping(value = "nextactuser/pending")
|
||||
@ResponseBody
|
||||
public AjaxResult getNextActUsersByPending(
|
||||
@RequestParam(value = "userOrgId") String userOrgId,
|
||||
@RequestParam(value = "curActInstId") String curActInstId,
|
||||
@RequestParam(value = "destActDefId") String destActDefId, @RequestBody SearchQuery searchQuery,
|
||||
HttpServletRequest request) {
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(userOrgId);
|
||||
searchQuery.setDestActDefId(destActDefId);
|
||||
searchQuery.setCurActInstId(curActInstId);
|
||||
List<ActivityResourceModel> rs = workflowService.getNextActUsers(searchQuery);
|
||||
return AjaxResult.success(rs);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取待办实例信息", notes = "获取待办实例信息")
|
||||
@GetMapping(value = "flowinfo/pending")
|
||||
@ResponseBody
|
||||
public AjaxResult getPendingFlowInstance(
|
||||
@RequestParam(value = "curActInstId") String curActInstId, HttpServletRequest request) throws Exception{
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SysUser user = userService.selectUserByUserName(userId);
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(user.getDeptId().toString());
|
||||
searchQuery.setCurActInstId(curActInstId);
|
||||
searchQuery.setStatus(1);
|
||||
HashMap<String, Object> flowInfoMap = workflowService.getFLowInfo(searchQuery);
|
||||
return AjaxResult.success(flowInfoMap);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取已办实例信息", notes = "获取已办实例信息")
|
||||
@GetMapping(value = "flowinfo/yiban")
|
||||
@ResponseBody
|
||||
public AjaxResult getYiBanFlowInstance(
|
||||
@RequestParam(value = "curActInstId") String curActInstId, HttpServletRequest request) throws Exception{
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SysUser user = userService.selectUserByUserName(userId);
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(user.getDeptId().toString());
|
||||
searchQuery.setCurActInstId(curActInstId);
|
||||
searchQuery.setStatus(2);
|
||||
HashMap<String, Object> flowInfoMap = workflowService.getFLowInfo(searchQuery);
|
||||
return AjaxResult.success(flowInfoMap);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取办结实例信息", notes = "获取办结实例信息")
|
||||
@GetMapping(value = "flowinfo/banjie")
|
||||
@ResponseBody
|
||||
public AjaxResult getBanJieFlowInstance(
|
||||
@RequestParam(value = "procInstId") String procInstId,
|
||||
HttpServletRequest request) throws Exception{
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SysUser user = userService.selectUserByUserName(userId);
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setUserId(userId);
|
||||
searchQuery.setUserOrgId(user.getDeptId().toString());
|
||||
searchQuery.setProcInstId(procInstId);
|
||||
searchQuery.setStatus(3);
|
||||
HashMap<String, Object> flowInfoMap = workflowService.getFLowInfo(searchQuery);
|
||||
return AjaxResult.success(flowInfoMap);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "新建页面,判断下一环节是否自动提交", notes = "新建页面,判断下一环节是否自动提交")
|
||||
@GetMapping(value = "autocommit/new/{procDefId}/{curActDefId}")
|
||||
@ResponseBody
|
||||
public AjaxResult checkAutoCommitByNew(
|
||||
@PathVariable("procDefId") String procDefId, @PathVariable("curActDefId") String curActDefId) throws Exception{
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setProcDefId(procDefId);
|
||||
searchQuery.setCurActDefId(curActDefId);
|
||||
String actDefId = workflowService.checkAutoCommit(searchQuery);
|
||||
return AjaxResult.success("",actDefId);
|
||||
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "待办页面,判断下一环节是否自动提交", notes = "待办页面,判断下一环节是否自动提交")
|
||||
@GetMapping(value = "autocommit/pending/{curActInstId}")
|
||||
@ResponseBody
|
||||
public AjaxResult checkAutoCommitByPending(
|
||||
@PathVariable("curActInstId") String curActInstId) throws Exception{
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setCurActInstId(curActInstId);
|
||||
String actDefId = workflowService.checkAutoCommit(searchQuery);
|
||||
return AjaxResult.success("",actDefId);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "待办页面,判断下一环节是否自动跳转", notes = "待办页面,判断下一环节是否自动跳转")
|
||||
@GetMapping(value = "autoJump/pending/{curActInstId}")
|
||||
@ResponseBody
|
||||
public AjaxResult checkAutoJumpByPending(
|
||||
@PathVariable("curActInstId") String curActInstId) throws Exception{
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setCurActInstId(curActInstId);
|
||||
Map<String, Object> actDefId = workflowService.checkAutoJump(searchQuery);
|
||||
return AjaxResult.success("",actDefId);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "新建页面,判断下一环节是否自动提交", notes = "新建页面,判断下一环节是否自动提交")
|
||||
@GetMapping(value = "autoJump/new/{procDefId}/{curActDefId}")
|
||||
@ResponseBody
|
||||
public AjaxResult checkAutoJumpByNew(
|
||||
@PathVariable("procDefId") String procDefId, @PathVariable("curActDefId") String curActDefId) throws Exception{
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setProcDefId(procDefId);
|
||||
searchQuery.setCurActDefId(curActDefId);
|
||||
Map<String, Object> actDefId = workflowService.checkAutoJump(searchQuery);
|
||||
return AjaxResult.success("",actDefId);
|
||||
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "提交流程", notes = "提交流程")
|
||||
@PostMapping(value = "submit")
|
||||
@ResponseBody
|
||||
public AjaxResult submitNewFLowInstance(@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.submit.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "暂存流程", notes = "暂存流程")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public AjaxResult saveFLowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.save.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程作废
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "作废流程", notes = "作废流程")
|
||||
@PostMapping(value = "cancel")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult cancelFlowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.cancel.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程实例撤回到拟稿人环节
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "流程实例撤回到拟稿人环节", notes = "流程实例撤回到拟稿人环节")
|
||||
@PostMapping(value = "backtostart")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult callBackStartFlowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.backtostart.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程实例撤回到上一环节
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "流程实例撤回到上一环节", notes = "流程实例撤回到上一环节")
|
||||
@PostMapping(value = "backtoprev")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult backToPrevFlowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.backtoprev.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交流程驳回参数
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @return
|
||||
*/
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "流程驳回", notes = "流程驳回")
|
||||
@PostMapping(value = "reject")
|
||||
@ResponseBody
|
||||
public AjaxResult rejectFlowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.reject.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程撤回
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @return
|
||||
*/
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "流程撤回", notes = "流程撤回")
|
||||
@PostMapping(value = "back")
|
||||
@ResponseBody
|
||||
public AjaxResult backFlowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.back.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程转派", notes = "流程转派")
|
||||
@PostMapping(value = "transfer")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult transferFlowInstance(
|
||||
@RequestBody BpmClientInputModelBo bpmClientInputModelBo) throws Exception{
|
||||
ProcessInstanceModel processInstanceModel = workflowService.processProcInst(bpmClientInputModelBo,
|
||||
WorkflowService.ENUM_ACTION.transfer.name());
|
||||
return AjaxResult.success(processInstanceModel);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "流程日志", notes = "流程日志")
|
||||
@PostMapping(value = "getLog")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getProcInstLog(
|
||||
@RequestBody BpmClientInputModel bpmClientInputModel) {
|
||||
HashMap<String, Object> procInstLog = workflowService.getProcInstLog(bpmClientInputModel);
|
||||
return AjaxResult.success(procInstLog);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "办件阅件列表查询", notes = "办件阅件列表查询")
|
||||
@PostMapping(value = "/list")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getRecordList(@RequestBody SearchQuery searchQuery) {
|
||||
PageResultModel pageResult = workflowService.findRecordList(searchQuery);
|
||||
return AjaxResult.success(pageResult);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "待办/已办列表查询", notes = "待办/已办列表查询")
|
||||
@PostMapping(value = "/toDoList")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getToDoList(@RequestBody SearchQuery searchQuery) throws Exception{
|
||||
//接收人
|
||||
WorkFlowPageVo pageResult = workflowService.findToDoList(searchQuery);
|
||||
return AjaxResult.success(pageResult);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取流程实例图形监控链接地址", notes = "获取流程实例图形监控链接地址")
|
||||
@GetMapping(value = "histasklogurl/{procInstId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getHistasklogurl( @PathVariable String procInstId) throws Exception{
|
||||
String url = workflowService.getHistasklogurl(procInstId);
|
||||
return AjaxResult.success("",url);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取流程实例图形链接地址", notes = "获取流程实例图形监控链接地址")
|
||||
@GetMapping(value = "getImageUrl/{procDefId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getProcessImageUrl( @PathVariable String procDefId) throws Exception{
|
||||
String url = workflowService.getImageUrl( procDefId);
|
||||
return AjaxResult.success("",url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程状态
|
||||
*
|
||||
* @param procInstId
|
||||
* @param curActInstId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取流程状态", notes = "获取流程状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "procInstId", value = "流程实例id", dataType = "string", paramType = "path"),
|
||||
@ApiImplicitParam(name = "curActInstId", value = "当前环节实例id", dataType = "string", paramType = "path") })
|
||||
@GetMapping(value = "/getFlowStatus/{procInstId}/{curActInstId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getFlowStatus( @PathVariable String procInstId,
|
||||
@PathVariable String curActInstId) throws Exception{
|
||||
int flowStatus = workflowService.getFlowStatus(procInstId, curActInstId);
|
||||
return AjaxResult.success(flowStatus);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取流程实例信息,包含当前用户所对应实例状态", notes = "获取流程实例信息,包含当前用户所对应实例状态")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "procInstId", value = "流程实例id", dataType = "string", paramType = "path"),
|
||||
@ApiImplicitParam(name = "curActInstId", value = "当前环节实例id", dataType = "string", paramType = "path") })
|
||||
@GetMapping(value = "instance/{procInstId}/{curActInstId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getFlowProcessInstance(@PathVariable String procInstId, @PathVariable String curActInstId, HttpServletRequest request) throws Exception{
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
ProcessInstanceModel procInst = workflowService.getProcessInstance(procInstId, curActInstId,
|
||||
userId);
|
||||
return AjaxResult.success(procInst);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取流程环节定义信息", notes = "获取流程环节定义信息")
|
||||
@GetMapping(value = "activitydefinition/{procDefId}/{actDefId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getFlowActDef(
|
||||
@PathVariable String procDefId, @PathVariable String actDefId) throws Exception{
|
||||
ActivityDefinitionModel activityDefinitionModel = workflowService.getActDef( procDefId, actDefId);
|
||||
return AjaxResult.success(activityDefinitionModel);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取流程环节配置的表单", notes = "获取流程环节配置的表单")
|
||||
@GetMapping(value = "getFlowActForm/{procDefId}/{actDefId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getFlowActForm(
|
||||
@PathVariable String procDefId, @PathVariable String actDefId) throws Exception{
|
||||
Map<String, String> formUrl = workflowService.getFlowActForm( procDefId, actDefId);
|
||||
return AjaxResult.success(formUrl);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据流程实例id获取流程实例信息", notes = "根据流程实例id获取流程实例信息")
|
||||
@GetMapping(value = "/procInstInfo/{procInstId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getProcInstInfo(@PathVariable String procInstId)throws Exception {
|
||||
Map<String, Object> procInst = workflowService.getProcessInstById( procInstId);
|
||||
return AjaxResult.success(procInst);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据流程实例id获取流程实例信息和流程状态", notes = "根据流程实例id获取流程实例信息")
|
||||
@GetMapping(value = "/procInstInfoAndStatus/{procInstId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public Map<String, Object> procInstInfoAndStatus( @PathVariable String procInstId,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setRecUserId(userId);
|
||||
searchQuery.setStatus(1);
|
||||
searchQuery.setProcInstId(procInstId);
|
||||
PageResultModel pageResultModel = workflowService.findRecordList(searchQuery);
|
||||
if (pageResultModel == null || pageResultModel.getTotalCount() == 0) {
|
||||
return null;
|
||||
}else {
|
||||
return pageResultModel.getResult().get(0);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("获取流程信息 该用户的流程是待办还是已办", ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取当前用户流程实例数量", notes = "获取当前用户流程实例数量。status状态值{1:待办,2:已办,3:办结}")
|
||||
@GetMapping(value = "/count/{status}")
|
||||
@ResponseBody
|
||||
public Map<String, Integer> getRecordCount( @PathVariable int status,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setRecUserId(userId);
|
||||
searchQuery.setStatus(status);
|
||||
return workflowService.getRecordCount(searchQuery);
|
||||
} catch (Exception ex) {
|
||||
log.error("获取当前用户流程实例数量", ex);
|
||||
Map<String, Integer> result = new HashMap<>();
|
||||
result.put("count", 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据父流程实例id获取该流程的子流程,从而处理子流程", notes = "根据父流程实例id获取该流程的子流程,从而处理子流程")
|
||||
@GetMapping(value = "/subprocess/{status}/{procInstId}")
|
||||
public List<Map<String, Object>> getSubprocess( @PathVariable String status,
|
||||
@PathVariable String procInstId) {
|
||||
try {
|
||||
return workflowService.getSubprocess( status, procInstId);
|
||||
} catch (Exception ex) {
|
||||
log.error("根据父流程实例id获取该流程的子流程,从而处理子流程", ex);
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取该用户是否处理过该流程", notes = "获取该用户是否处理该流程")
|
||||
@GetMapping(value = "/flowinfo/user/deal/{procInstId}")
|
||||
@ResponseBody
|
||||
public AjaxResult getUserIsDealFlow( @PathVariable String procInstId,
|
||||
HttpServletRequest request) throws Exception{
|
||||
String userId = SecurityUtils.getLoginUser().getUsername();
|
||||
SearchQuery searchQuery = new SearchQuery();
|
||||
searchQuery.setRecUserId(userId);
|
||||
searchQuery.setProcInstId(procInstId);
|
||||
searchQuery.setStatus(1);
|
||||
Map<String, Integer> result = workflowService.getRecordCount(searchQuery);
|
||||
return AjaxResult.success(Integer.valueOf(result.get("count").toString()));
|
||||
}
|
||||
|
||||
@CrossOrigin
|
||||
@ApiOperation(value = "获取扩展属性", notes = "获取扩展属性")
|
||||
@GetMapping("/getExtAttributeModel")
|
||||
public AjaxResult getExtAttributeModel(@RequestParam("procDefId") String procDefId, @RequestParam("actDefId") String actDefId){
|
||||
return AjaxResult.success(workflowService.getExtAttributeModel(procDefId, actDefId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "待办列表查询", notes = "待办列表查询")
|
||||
@GetMapping(value = "/getRecord/{procInstId}")
|
||||
@ResponseBody
|
||||
@CrossOrigin
|
||||
public AjaxResult getRecordbyPorcInstId(@PathVariable String procInstId) throws Exception{
|
||||
return AjaxResult.success(workflowService.getRecordbyPorcInstId(procInstId));
|
||||
}
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package com.rzdata.web.controller.tool;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.rzdata.common.annotation.Log;
|
||||
import com.rzdata.common.core.controller.BaseController;
|
||||
import com.rzdata.common.core.domain.AjaxResult;
|
||||
import com.rzdata.common.enums.BusinessType;
|
||||
import com.rzdata.web.domain.WorkflowLog;
|
||||
import com.rzdata.web.service.IWorkflowLogService;
|
||||
import com.rzdata.common.utils.poi.ExcelUtil;
|
||||
import com.rzdata.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 流程审批记录Controller
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/web/log")
|
||||
public class WorkflowLogController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWorkflowLogService workflowLogService;
|
||||
|
||||
/**
|
||||
* 查询流程审批记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('web:log:list')")
|
||||
@GetMapping("/page")
|
||||
public TableDataInfo page(WorkflowLog workflowLog)
|
||||
{
|
||||
startPage();
|
||||
List<WorkflowLog> list = workflowLogService.selectWorkflowLogList(workflowLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(WorkflowLog workflowLog)
|
||||
{
|
||||
return AjaxResult.success(workflowLogService.selectWorkflowLogList(workflowLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程审批记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('web:log:export')")
|
||||
@Log(title = "流程审批记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WorkflowLog workflowLog)
|
||||
{
|
||||
List<WorkflowLog> list = workflowLogService.selectWorkflowLogList(workflowLog);
|
||||
ExcelUtil<WorkflowLog> util = new ExcelUtil<WorkflowLog>(WorkflowLog.class);
|
||||
util.exportExcel(response, list, "流程审批记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程审批记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('web:log:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(workflowLogService.selectWorkflowLogById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程审批记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('web:log:add')")
|
||||
@Log(title = "流程审批记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WorkflowLog workflowLog)
|
||||
{
|
||||
return toAjax(workflowLogService.insertWorkflowLog(workflowLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程审批记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('web:log:edit')")
|
||||
@Log(title = "流程审批记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WorkflowLog workflowLog)
|
||||
{
|
||||
return toAjax(workflowLogService.updateWorkflowLog(workflowLog));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程审批记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('web:log:remove')")
|
||||
@Log(title = "流程审批记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(workflowLogService.deleteWorkflowLogByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.rzdata.web.core.config;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 读取项目相关配置
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "bpmc")
|
||||
public class BpmcConfig {
|
||||
|
||||
/**
|
||||
* 流程平台下应用租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 流程平台服务接口地址
|
||||
*/
|
||||
private String serviceUrl;
|
||||
|
||||
/**
|
||||
* 待办地址前缀
|
||||
*/
|
||||
private String uniteWorkUrl;
|
||||
}
|
@ -4,6 +4,8 @@ import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.annotation.Excels;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import com.rzdata.common.core.domain.entity.SysDept;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
@ -13,6 +15,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
* @author ja
|
||||
* @date 2024-07-15
|
||||
*/
|
||||
@Data
|
||||
public class Tool extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -79,165 +82,11 @@ public class Tool extends BaseEntity
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
public void setToolId(String toolId)
|
||||
{
|
||||
this.toolId = toolId;
|
||||
}
|
||||
private BpmClientInputModelBo bpmClientInputModel;
|
||||
|
||||
public String getToolId()
|
||||
{
|
||||
return toolId;
|
||||
}
|
||||
private String recordStatus;
|
||||
|
||||
public void setToolCode(String toolCode)
|
||||
{
|
||||
this.toolCode = toolCode;
|
||||
}
|
||||
private Boolean editStatus;
|
||||
|
||||
public String getToolCode()
|
||||
{
|
||||
return toolCode;
|
||||
}
|
||||
public void setToolName(String toolName)
|
||||
{
|
||||
this.toolName = toolName;
|
||||
}
|
||||
|
||||
public String getToolName()
|
||||
{
|
||||
return toolName;
|
||||
}
|
||||
public void setToolType(String toolType)
|
||||
{
|
||||
this.toolType = toolType;
|
||||
}
|
||||
|
||||
public String getToolType()
|
||||
{
|
||||
return toolType;
|
||||
}
|
||||
public void setToolSource(String toolSource)
|
||||
{
|
||||
this.toolSource = toolSource;
|
||||
}
|
||||
|
||||
public String getToolSource()
|
||||
{
|
||||
return toolSource;
|
||||
}
|
||||
public void setToolUse(String toolUse)
|
||||
{
|
||||
this.toolUse = toolUse;
|
||||
}
|
||||
|
||||
public String getToolUse()
|
||||
{
|
||||
return toolUse;
|
||||
}
|
||||
public void setTestSituation(String testSituation)
|
||||
{
|
||||
this.testSituation = testSituation;
|
||||
}
|
||||
|
||||
public String getTestSituation()
|
||||
{
|
||||
return testSituation;
|
||||
}
|
||||
public void setFunctionDesc(String functionDesc)
|
||||
{
|
||||
this.functionDesc = functionDesc;
|
||||
}
|
||||
|
||||
public String getFunctionDesc()
|
||||
{
|
||||
return functionDesc;
|
||||
}
|
||||
public void setApplyCondition(String applyCondition)
|
||||
{
|
||||
this.applyCondition = applyCondition;
|
||||
}
|
||||
|
||||
public String getApplyCondition()
|
||||
{
|
||||
return applyCondition;
|
||||
}
|
||||
public void setOperateExplain(String operateExplain)
|
||||
{
|
||||
this.operateExplain = operateExplain;
|
||||
}
|
||||
|
||||
public String getOperateExplain()
|
||||
{
|
||||
return operateExplain;
|
||||
}
|
||||
public void setToolPrincipals(String toolPrincipals)
|
||||
{
|
||||
this.toolPrincipals = toolPrincipals;
|
||||
}
|
||||
|
||||
public String getToolPrincipals()
|
||||
{
|
||||
return toolPrincipals;
|
||||
}
|
||||
|
||||
public void setToolPrincipalsName(String toolPrincipalsName)
|
||||
{
|
||||
this.toolPrincipalsName = toolPrincipalsName;
|
||||
}
|
||||
|
||||
public String getToolPrincipalsName()
|
||||
{
|
||||
return toolPrincipalsName;
|
||||
}
|
||||
public void setToolRespDept(String toolRespDept)
|
||||
{
|
||||
this.toolRespDept = toolRespDept;
|
||||
}
|
||||
|
||||
public String getToolRespDept()
|
||||
{
|
||||
return toolRespDept;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public SysDept getDept()
|
||||
{
|
||||
return dept;
|
||||
}
|
||||
|
||||
public void setDept(SysDept dept)
|
||||
{
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("toolId", getToolId())
|
||||
.append("toolName", getToolName())
|
||||
.append("toolType", getToolType())
|
||||
.append("toolSource", getToolSource())
|
||||
.append("toolUse", getToolUse())
|
||||
.append("testSituation", getTestSituation())
|
||||
.append("functionDesc", getFunctionDesc())
|
||||
.append("applyCondition", getApplyCondition())
|
||||
.append("operateExplain", getOperateExplain())
|
||||
.append("toolPrincipals", getToolPrincipals())
|
||||
.append("toolRespDept", getToolRespDept())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
private String procInstId;
|
||||
}
|
||||
|
@ -0,0 +1,45 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 使用申请对象 t_use_apply
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
public class UseApply extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 申请人 */
|
||||
@Excel(name = "申请人")
|
||||
private String userName;
|
||||
|
||||
/** 申请部门 */
|
||||
@Excel(name = "申请部门")
|
||||
private String deptId;
|
||||
|
||||
/** 申请理由 */
|
||||
@Excel(name = "申请理由")
|
||||
private String reason;
|
||||
|
||||
private BpmClientInputModelBo bpmClientInputModel;
|
||||
|
||||
private String recordStatus;
|
||||
|
||||
private Boolean editStatus;
|
||||
|
||||
private String procInstId;
|
||||
|
||||
private List<UseApplyItem> itemList;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 使用申请详情对象 t_use_apply_item
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
public class UseApplyItem extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 申请主键 */
|
||||
@Excel(name = "申请主键")
|
||||
private String applyId;
|
||||
|
||||
/** 工具id */
|
||||
@Excel(name = "工具id")
|
||||
private String toolId;
|
||||
|
||||
/** 工具编号 */
|
||||
@Excel(name = "工具编号")
|
||||
private String toolCode;
|
||||
|
||||
/** 工具名称 */
|
||||
@Excel(name = "工具名称")
|
||||
private String toolName;
|
||||
|
||||
/** 工具类别 */
|
||||
@Excel(name = "工具类别")
|
||||
private String toolType;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String toolPrincipals;
|
||||
|
||||
/** 负责人名称 */
|
||||
@Excel(name = "负责人名称")
|
||||
private String toolPrincipalsName;
|
||||
|
||||
/** 归属单位 */
|
||||
@Excel(name = "归属单位")
|
||||
private String toolRespDept;
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @auther xcy
|
||||
* @create 2021-12-30 15:41
|
||||
*/
|
||||
@Data
|
||||
public class WorkFlowInfo {
|
||||
|
||||
@ApiModelProperty("主键")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("当前活动定义名称")
|
||||
private String curActDefName;
|
||||
|
||||
@ApiModelProperty("父流程Id")
|
||||
private String parentProcInstId;
|
||||
|
||||
@ApiModelProperty("接收人姓名")
|
||||
private String recUserName;
|
||||
|
||||
@ApiModelProperty("前一活动名称")
|
||||
private String prevActDefName;
|
||||
|
||||
@ApiModelProperty("流程定义key")
|
||||
private String procDefKey;
|
||||
|
||||
@ApiModelProperty("接收人Id")
|
||||
private String recUserId;
|
||||
|
||||
@ApiModelProperty("发送人组织名称")
|
||||
private String sendOrgName;
|
||||
|
||||
@ApiModelProperty("流程定义Id")
|
||||
private String procDefId;
|
||||
|
||||
@ApiModelProperty("发送时间")
|
||||
private String sendTime;
|
||||
|
||||
@ApiModelProperty("处理时间")
|
||||
private String dealTime;
|
||||
|
||||
@ApiModelProperty("流程定义名称")
|
||||
private String procDefName;
|
||||
|
||||
private String dataSource;
|
||||
|
||||
@ApiModelProperty("待办:1 已办:2 办结:3 待阅:4 已阅:5 作废:6 删除:7")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("桌面端访问协议")
|
||||
private String cportalProtocol;
|
||||
|
||||
@ApiModelProperty("发送人组织Id")
|
||||
private String sendOrgId;
|
||||
|
||||
private String serviceCode;
|
||||
|
||||
@ApiModelProperty("前一活动定义Id")
|
||||
private String prevActDefId;
|
||||
|
||||
@ApiModelProperty("手机端访问协议")
|
||||
private String mportalProtocol;
|
||||
|
||||
@ApiModelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("手机端URL")
|
||||
private String mportalUrl;
|
||||
|
||||
@ApiModelProperty("顶级流程Id")
|
||||
private String topProcInstId;
|
||||
|
||||
@ApiModelProperty("内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty("发送人Id")
|
||||
private String sendUserId;
|
||||
|
||||
@ApiModelProperty("流程起草人Id")
|
||||
private String startUserId;
|
||||
|
||||
@ApiModelProperty("流程起草人姓名")
|
||||
private String startUserName;
|
||||
|
||||
@ApiModelProperty("当前活动处理时限")
|
||||
private String curActLimitTime;
|
||||
|
||||
@ApiModelProperty("发送人姓名")
|
||||
private String sendUserName;
|
||||
|
||||
@ApiModelProperty("当前活动实例Id")
|
||||
private String curActInstId;
|
||||
|
||||
@ApiModelProperty("起草时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("前一活动实例Id")
|
||||
private String prevActInstId;
|
||||
|
||||
@ApiModelProperty("流程实例Id")
|
||||
private String procInstId;
|
||||
|
||||
@ApiModelProperty("桌面端URL")
|
||||
private String url;
|
||||
|
||||
private String wportalProtocol;
|
||||
|
||||
@ApiModelProperty("接收人组织名称")
|
||||
private String recOrgName;
|
||||
|
||||
@ApiModelProperty("接收人组织Id")
|
||||
private String recOrgId;
|
||||
|
||||
@ApiModelProperty("当前活动定义Id")
|
||||
private String curActDefId;
|
||||
|
||||
@ApiModelProperty("业务数据")
|
||||
private Object businessData;
|
||||
|
||||
//是否删除,1:正常 0:删除
|
||||
private Integer flag = 1;
|
||||
|
||||
private String docName;
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
package com.rzdata.web.domain;
|
||||
|
||||
import com.rzdata.common.annotation.Excel;
|
||||
import com.rzdata.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 流程审批记录对象 t_workflow_log
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Data
|
||||
public class WorkflowLog extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 流程实例ID */
|
||||
@Excel(name = "流程实例ID")
|
||||
private String procInstId;
|
||||
|
||||
/** 流程实例key */
|
||||
@Excel(name = "流程实例key")
|
||||
private String procDefKey;
|
||||
|
||||
/** 业务ID */
|
||||
@Excel(name = "业务ID")
|
||||
private String businessId;
|
||||
|
||||
/** 当前环节定义Id */
|
||||
@Excel(name = "当前环节定义Id")
|
||||
private String actDefId;
|
||||
|
||||
/** 当前环节定义名称 */
|
||||
@Excel(name = "当前环节定义名称")
|
||||
private String actDefName;
|
||||
|
||||
/** 下一环节定义Id */
|
||||
@Excel(name = "下一环节定义Id")
|
||||
private String nextDefId;
|
||||
|
||||
/** 下一环节定义名称 */
|
||||
@Excel(name = "下一环节定义名称")
|
||||
private String nextDefName;
|
||||
|
||||
/** 环节实例ID */
|
||||
@Excel(name = "环节实例ID")
|
||||
private String actInstId;
|
||||
|
||||
/** 意见 */
|
||||
@Excel(name = "意见")
|
||||
private String opinion;
|
||||
|
||||
/** 发送人 */
|
||||
@Excel(name = "发送人")
|
||||
private String sender;
|
||||
|
||||
/** 发送人部门 */
|
||||
@Excel(name = "发送人部门")
|
||||
private String senderDeptId;
|
||||
|
||||
/** 接收人 */
|
||||
@Excel(name = "接收人")
|
||||
private String receiver;
|
||||
|
||||
/** 环节处理状态 */
|
||||
@Excel(name = "环节处理状态")
|
||||
private String actStatus;
|
||||
|
||||
/** 是否通过 */
|
||||
@Excel(name = "是否通过")
|
||||
private Boolean pass;
|
||||
|
||||
/** 租户id */
|
||||
@Excel(name = "租户id")
|
||||
private String tenantId;
|
||||
|
||||
/** 是否审核 */
|
||||
@Excel(name = "是否审核")
|
||||
private Boolean review;
|
||||
|
||||
/** 批次 */
|
||||
@Excel(name = "批次")
|
||||
private String batch;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.rzdata.web.domain.bo;
|
||||
|
||||
import com.blueland.bpmclient.model.BpmClientInputModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author WangYang
|
||||
* @Date 2022/2/11 15:12
|
||||
* @Version 1.0
|
||||
* @Description
|
||||
*/
|
||||
@Data
|
||||
public class BpmClientInputModelBo implements Serializable {
|
||||
|
||||
private BpmClientInputModel model;
|
||||
|
||||
/**
|
||||
* 申请结果
|
||||
*/
|
||||
private Boolean applyStatus;
|
||||
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否有审核
|
||||
*/
|
||||
private Boolean review;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.rzdata.web.domain.vo;
|
||||
|
||||
import com.rzdata.web.domain.WorkFlowInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther xcy
|
||||
* @create 2021-12-31 10:49
|
||||
*/
|
||||
@Data
|
||||
public class WorkFlowPageVo {
|
||||
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
|
||||
@ApiModelProperty("总数")
|
||||
private Integer totalCount;
|
||||
|
||||
@ApiModelProperty("页码")
|
||||
private Integer pageNumber;
|
||||
|
||||
@ApiModelProperty("流程详情信息")
|
||||
private List<WorkFlowInfo> result;
|
||||
|
||||
}
|
@ -20,6 +20,8 @@ public interface ToolMapper
|
||||
*/
|
||||
public Tool selectToolByToolId(String toolId);
|
||||
|
||||
Tool getInfoByBpmcId(String bpmcId);
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*
|
||||
|
@ -0,0 +1,63 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApplyItem;
|
||||
|
||||
/**
|
||||
* 使用申请详情Mapper接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface UseApplyItemMapper
|
||||
{
|
||||
/**
|
||||
* 查询使用申请详情
|
||||
*
|
||||
* @param id 使用申请详情主键
|
||||
* @return 使用申请详情
|
||||
*/
|
||||
public UseApplyItem selectUseApplyItemById(String id);
|
||||
|
||||
/**
|
||||
* 查询使用申请详情列表
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 使用申请详情集合
|
||||
*/
|
||||
public List<UseApplyItem> selectUseApplyItemList(UseApplyItem useApplyItem);
|
||||
|
||||
/**
|
||||
* 新增使用申请详情
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUseApplyItem(UseApplyItem useApplyItem);
|
||||
|
||||
/**
|
||||
* 修改使用申请详情
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUseApplyItem(UseApplyItem useApplyItem);
|
||||
|
||||
/**
|
||||
* 删除使用申请详情
|
||||
*
|
||||
* @param id 使用申请详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyItemById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除使用申请详情
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyItemByIds(String[] ids);
|
||||
|
||||
int deleteByApplyId(String applyId);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
|
||||
/**
|
||||
* 使用申请Mapper接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface UseApplyMapper
|
||||
{
|
||||
/**
|
||||
* 查询使用申请
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
public UseApply selectUseApplyById(String id);
|
||||
|
||||
UseApply getInfoByBpmcId(String bpmcId);
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 使用申请集合
|
||||
*/
|
||||
public List<UseApply> selectUseApplyList(UseApply useApply);
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUseApply(UseApply useApply);
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUseApply(UseApply useApply);
|
||||
|
||||
/**
|
||||
* 删除使用申请
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.rzdata.web.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.WorkflowLog;
|
||||
|
||||
/**
|
||||
* 流程审批记录Mapper接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface WorkflowLogMapper
|
||||
{
|
||||
/**
|
||||
* 查询流程审批记录
|
||||
*
|
||||
* @param id 流程审批记录主键
|
||||
* @return 流程审批记录
|
||||
*/
|
||||
public WorkflowLog selectWorkflowLogById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程审批记录列表
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 流程审批记录集合
|
||||
*/
|
||||
public List<WorkflowLog> selectWorkflowLogList(WorkflowLog workflowLog);
|
||||
|
||||
/**
|
||||
* 新增流程审批记录
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWorkflowLog(WorkflowLog workflowLog);
|
||||
|
||||
/**
|
||||
* 修改流程审批记录
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWorkflowLog(WorkflowLog workflowLog);
|
||||
|
||||
/**
|
||||
* 删除流程审批记录
|
||||
*
|
||||
* @param id 流程审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWorkflowLogById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除流程审批记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWorkflowLogByIds(String[] ids);
|
||||
}
|
@ -20,6 +20,8 @@ public interface IToolService
|
||||
*/
|
||||
public Tool selectToolByToolId(String toolId);
|
||||
|
||||
Tool getInfoByBpmcId(String bpmcId);
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*
|
||||
|
@ -0,0 +1,63 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApplyItem;
|
||||
|
||||
/**
|
||||
* 使用申请详情Service接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IUseApplyItemService
|
||||
{
|
||||
/**
|
||||
* 查询使用申请详情
|
||||
*
|
||||
* @param id 使用申请详情主键
|
||||
* @return 使用申请详情
|
||||
*/
|
||||
public UseApplyItem selectUseApplyItemById(String id);
|
||||
|
||||
/**
|
||||
* 查询使用申请详情列表
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 使用申请详情集合
|
||||
*/
|
||||
public List<UseApplyItem> selectUseApplyItemList(UseApplyItem useApplyItem);
|
||||
|
||||
/**
|
||||
* 新增使用申请详情
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUseApplyItem(UseApplyItem useApplyItem);
|
||||
|
||||
/**
|
||||
* 修改使用申请详情
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUseApplyItem(UseApplyItem useApplyItem);
|
||||
|
||||
/**
|
||||
* 批量删除使用申请详情
|
||||
*
|
||||
* @param ids 需要删除的使用申请详情主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyItemByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除使用申请详情信息
|
||||
*
|
||||
* @param id 使用申请详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyItemById(String id);
|
||||
|
||||
void updateItemList(List<UseApplyItem> list, String applyId);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
|
||||
/**
|
||||
* 使用申请Service接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IUseApplyService
|
||||
{
|
||||
/**
|
||||
* 查询使用申请
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
public UseApply selectUseApplyById(String id);
|
||||
|
||||
UseApply getInfoByBpmcId(String bpmcId);
|
||||
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 使用申请集合
|
||||
*/
|
||||
public List<UseApply> selectUseApplyList(UseApply useApply);
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUseApply(UseApply useApply);
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUseApply(UseApply useApply);
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
*
|
||||
* @param ids 需要删除的使用申请主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除使用申请信息
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUseApplyById(String id);
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.web.domain.WorkflowLog;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
|
||||
/**
|
||||
* 流程审批记录Service接口
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
public interface IWorkflowLogService
|
||||
{
|
||||
/**
|
||||
* 查询流程审批记录
|
||||
*
|
||||
* @param id 流程审批记录主键
|
||||
* @return 流程审批记录
|
||||
*/
|
||||
public WorkflowLog selectWorkflowLogById(String id);
|
||||
|
||||
/**
|
||||
* 查询流程审批记录列表
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 流程审批记录集合
|
||||
*/
|
||||
public List<WorkflowLog> selectWorkflowLogList(WorkflowLog workflowLog);
|
||||
|
||||
/**
|
||||
* 新增流程审批记录
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWorkflowLog(WorkflowLog workflowLog);
|
||||
|
||||
/**
|
||||
* 修改流程审批记录
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWorkflowLog(WorkflowLog workflowLog);
|
||||
|
||||
/**
|
||||
* 批量删除流程审批记录
|
||||
*
|
||||
* @param ids 需要删除的流程审批记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWorkflowLogByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除流程审批记录信息
|
||||
*
|
||||
* @param id 流程审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWorkflowLogById(String id);
|
||||
|
||||
void saveProcLog(BpmClientInputModelBo bpmClientInputModelBo, ProcessInstanceModel processInst, String action);
|
||||
}
|
@ -0,0 +1,779 @@
|
||||
package com.rzdata.web.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.blueland.bpmclient.BpmClient;
|
||||
import com.blueland.bpmclient.model.*;
|
||||
import com.rzdata.common.utils.SecurityUtils;
|
||||
import com.rzdata.common.utils.StringUtils;
|
||||
import com.rzdata.system.service.ISysConfigService;
|
||||
import com.rzdata.system.service.ISysDeptService;
|
||||
import com.rzdata.web.core.config.BpmcConfig;
|
||||
import com.rzdata.web.domain.WorkFlowInfo;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import com.rzdata.web.domain.vo.WorkFlowPageVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.rmi.ServerException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service("workflowService")
|
||||
public class WorkflowService {
|
||||
private static int FLOW_STATUS_ERROR = 0;// 异常
|
||||
private static int FLOW_STATUS_UNREAD = 1;// 待办
|
||||
private static int FLOW_STATUS_READ = 2;// 已办
|
||||
private static int FLOW_STATUS_FINISH = 3;// 办结
|
||||
private static String END_ACT_NAME = "结束";
|
||||
/**
|
||||
* 是否从通讯录选择下一步人员
|
||||
*/
|
||||
private static String SHOW_TXL_SELECT = "show_txl_select";
|
||||
@Autowired
|
||||
private BpmcConfig bpmcConfig;
|
||||
|
||||
@Autowired
|
||||
ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
ISysDeptService sysDeptService;
|
||||
|
||||
@Autowired
|
||||
IWorkflowLogService iWorkflowLogService;
|
||||
private final static String CUR_ACT_DEF_KEY = "curActDef";
|
||||
private final static String CUR_ACT_INST_KEY = "curActInst";
|
||||
private final static String PROC_INST_KEY = "procInst";
|
||||
private final static String PROC_DEF_KEY = "procDef";
|
||||
private final static String ACT_OPPOWERS = "actOppowers";// 下一环节显示按钮
|
||||
|
||||
public enum ENUM_ACTION {
|
||||
/**
|
||||
* // 暂存
|
||||
*/
|
||||
save,
|
||||
/**
|
||||
* // 提交
|
||||
*/
|
||||
submit,
|
||||
/**
|
||||
* // 作废
|
||||
*/
|
||||
cancel,
|
||||
/**
|
||||
* // 转派
|
||||
*/
|
||||
transfer,
|
||||
/**
|
||||
* // 退回拟稿人
|
||||
*/
|
||||
backtostart,
|
||||
/**
|
||||
* // 退回上一步
|
||||
*/
|
||||
backtoprev,
|
||||
/**
|
||||
* // 撤回
|
||||
*/
|
||||
back,
|
||||
/**
|
||||
* // 驳回
|
||||
*/
|
||||
reject,
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
BpmClient getBpmClient() {
|
||||
WorkflowConfig workflowConfig = new WorkflowConfig();
|
||||
workflowConfig.setTenantId(bpmcConfig.getTenantId());
|
||||
workflowConfig.setBaseURL(bpmcConfig.getServiceUrl());
|
||||
BpmClient bpmClient = new BpmClient(workflowConfig);
|
||||
return bpmClient;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 暂存流程
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @param businessId 业务id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public ProcessInstanceModel saveExecute(BpmClientInputModelBo bpmClientInputModelBo, String businessId) throws Exception {
|
||||
bpmClientInputModelBo.getModel().setWf_businessKey(businessId);
|
||||
return processProcInst(bpmClientInputModelBo, ENUM_ACTION.save.name());
|
||||
}
|
||||
|
||||
/**
|
||||
* 下一步流程
|
||||
*
|
||||
* @param bpmClientInputModelBo
|
||||
* @param businessId 业务id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public ProcessInstanceModel nextExecute(BpmClientInputModelBo bpmClientInputModelBo, String businessId) throws Exception {
|
||||
bpmClientInputModelBo.getModel().setWf_businessKey(businessId);
|
||||
return processProcInst(bpmClientInputModelBo, ENUM_ACTION.submit.name());
|
||||
}
|
||||
|
||||
public ProcessInstanceModel cancelExecute(BpmClientInputModelBo bpmClientInputModelBo, String businessId) throws Exception {
|
||||
bpmClientInputModelBo.getModel().setWf_businessKey(businessId);
|
||||
return processProcInst(bpmClientInputModelBo, ENUM_ACTION.cancel.name());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理流程实例
|
||||
*
|
||||
* @param action 处理操作类型
|
||||
* @return
|
||||
*/
|
||||
public ProcessInstanceModel processProcInst(BpmClientInputModelBo bpmClientInputModelBo, String action)
|
||||
throws Exception {
|
||||
ProcessInstanceModel processInst = new ProcessInstanceModel();
|
||||
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
|
||||
// 待办URL
|
||||
String url = this.bpmcConfig.getUniteWorkUrl()+ "?businessKey=" + bpmClientInputModel.getWf_businessKey()+ "&type=" + bpmClientInputModelBo.getType();
|
||||
bpmClientInputModel.setWf_uniteworkUrl(url);
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
switch (ENUM_ACTION.valueOf(action)) {
|
||||
case cancel:// 作废
|
||||
processInst = bpmClient.cancelProcInst(bpmClientInputModel);
|
||||
break;
|
||||
case backtostart:// 返回拟稿人
|
||||
processInst = bpmClient.callBackStart(bpmClientInputModel);
|
||||
bpmClientInputModel.setWf_nextActDefName(processInst.getNextActInsts().get(0).getActDefName());
|
||||
break;
|
||||
case backtoprev:// 返回上一步
|
||||
processInst = bpmClient.backToPrev(bpmClientInputModel);
|
||||
break;
|
||||
case back:// 撤回
|
||||
processInst = bpmClient.callBack(bpmClientInputModel);
|
||||
break;
|
||||
case transfer:// 转派
|
||||
processInst = bpmClient.transfer(bpmClientInputModel);
|
||||
break;
|
||||
case reject:// 驳回
|
||||
processInst = bpmClient.rejectFlow(bpmClientInputModel);
|
||||
break;
|
||||
case save:
|
||||
processInst = bpmClient.saveFlowInstance(bpmClientInputModel);
|
||||
break;
|
||||
case submit:
|
||||
processInst = bpmClient.submitFlowInstance(bpmClientInputModel);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (processInst!=null&& StringUtils.isNotEmpty(processInst.getProcInstId())) {
|
||||
iWorkflowLogService.saveProcLog(bpmClientInputModelBo, processInst,action);
|
||||
}
|
||||
return processInst;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程实例完整信息,包含流程实例、当前环节实例、流程定义等信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String, Object> getFLowInfo(SearchQuery searchQuery) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
HashMap<String, Object> returnDataMap = new HashMap<>();
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
JSONObject jo = new JSONObject();
|
||||
try {
|
||||
jo = getFlowInfo(searchQuery);
|
||||
if (jo == null) {
|
||||
return null;
|
||||
}
|
||||
if (!jo.containsKey(CUR_ACT_DEF_KEY) || !jo.containsKey(CUR_ACT_INST_KEY) || !jo.containsKey(PROC_INST_KEY)
|
||||
|| !jo.containsKey(PROC_DEF_KEY)) {
|
||||
throw new Exception("返回的数据不完整");
|
||||
}
|
||||
returnDataMap.put(CUR_ACT_DEF_KEY, jo.getJSONObject(CUR_ACT_DEF_KEY));
|
||||
returnDataMap.put(CUR_ACT_INST_KEY, jo.getJSONObject(CUR_ACT_INST_KEY));
|
||||
returnDataMap.put(PROC_INST_KEY, jo.getJSONObject(PROC_INST_KEY));
|
||||
returnDataMap.put(PROC_DEF_KEY, jo.getJSONObject(PROC_DEF_KEY));
|
||||
returnDataMap.put(ACT_OPPOWERS, jo.getJSONArray(ACT_OPPOWERS));
|
||||
/**
|
||||
* JSONArray ja_log = jo.getJSONArray("procLogs"); ArrayList<HashMap<String,
|
||||
* Object>> list_log = Lists.newArrayList(); for (int i = 0; i < ja_log.size();
|
||||
* i++) { HashMap<String, Object> commentMap = Maps.newHashMap();
|
||||
* commentMap.put("actDefName",
|
||||
* ja_log.getJSONObject(i).getString("prevActDefName"));
|
||||
* commentMap.put("commentTime", ja_log.getJSONObject(i).get("startTime"));
|
||||
* commentMap.put("actDefId", ja_log.getJSONObject(i).get("prevActDefId"));
|
||||
* String orgId = ja_log.getJSONObject(i).getString("sendOrgId"); PubOrgEntity
|
||||
* deptEntry = pubOrgDao.get(orgId); String userName =
|
||||
* String.format("(%s-%s)%s", deptEntry.getCompanyName(),
|
||||
* deptEntry.getOrgName(), ja_log.getJSONObject(i).getString("sendUserName"));
|
||||
* commentMap.put("commentUserName", userName); commentMap.put("userName",
|
||||
* ja_log.getJSONObject(i).getString("sendUserName"));
|
||||
* commentMap.put("commentFullMessage",
|
||||
* ja_log.getJSONObject(i).get("commentFullMessage")); list_log.add(commentMap);
|
||||
* } returnDataMap.put("procLogs", list_log);
|
||||
*/
|
||||
// returnDataMap.put("transferLog",
|
||||
// projectCommentEntryMapper.findCommentListByParams(params));//获取流程实例转派审批日志
|
||||
} catch (Exception ex) {
|
||||
log.error("getFLowInfo==============" + JSON.toJSONString(searchQuery), ex);
|
||||
}
|
||||
return returnDataMap;
|
||||
}
|
||||
|
||||
JSONObject getFlowInfo(SearchQuery searchQuery) {
|
||||
String returnData = "";
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
switch (searchQuery.getStatus()) {
|
||||
case 1:
|
||||
returnData = bpmClient.getToDoFlowInfo(searchQuery);
|
||||
break;
|
||||
case 2:
|
||||
returnData = bpmClient.getYibanFlowInfo(searchQuery);
|
||||
break;
|
||||
case 3:
|
||||
returnData = bpmClient.getBanJieFlowInfo(searchQuery);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return JSON.parseObject(returnData);
|
||||
} catch (Exception ex) {
|
||||
log.error("=======流程平台返回信息:" + JSON.toJSONString(searchQuery), ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取流程实例日志
|
||||
*
|
||||
* @param bpmClientInputModel
|
||||
* @return
|
||||
*/
|
||||
public HashMap<String, Object> getProcInstLog(BpmClientInputModel bpmClientInputModel) {
|
||||
HashMap<String, Object> returnDataMap = new HashMap<>();
|
||||
List<Map<String, Object>> procLog;
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
if (StrUtil.isNotBlank(bpmClientInputModel.getWf_procInstId())) {
|
||||
String returnData = bpmClient.getProcInstLog(bpmClientInputModel.getWf_procInstId());
|
||||
Map<String, Object> procInstLog = JSONObject.parseObject(returnData, Map.class);
|
||||
if (null != procInstLog && procInstLog.containsKey("procLogs")) {
|
||||
// 获取日志实例
|
||||
procLog = (List<Map<String, Object>>) procInstLog.get("procLogs");
|
||||
procLog = dealEchoMap(procLog);
|
||||
JSONObject jo = JSON.parseObject(returnData);
|
||||
returnDataMap.put("procInst", jo.getJSONObject("procInst"));
|
||||
returnDataMap.put("procLogs", procLog);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("getProcInstLog==============" + JSON.toJSONString(bpmClientInputModel), ex);
|
||||
}
|
||||
return returnDataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉相关部门重复数据
|
||||
*
|
||||
* @param procLog
|
||||
* @return
|
||||
*/
|
||||
private List<Map<String, Object>> dealEchoMap(List<Map<String, Object>> procLog) {
|
||||
List<Map<String, Object>> newList = new ArrayList<Map<String, Object>>();
|
||||
// 去重
|
||||
for (int i = 0; i < procLog.size(); i++) {
|
||||
Map<String, Object> oldMap = procLog.get(i);
|
||||
if (newList.size() > 0) {
|
||||
boolean isContain = false;
|
||||
for (int j = 0; j < newList.size(); j++) {
|
||||
Map<String, Object> newMap = newList.get(j);
|
||||
if (newMap.get("prevActInstId").equals(oldMap.get("prevActInstId"))) {
|
||||
for (String k : oldMap.keySet()) {
|
||||
newMap.put(k, oldMap.get(k));
|
||||
}
|
||||
isContain = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isContain) {
|
||||
newList.add(oldMap);
|
||||
}
|
||||
|
||||
} else {
|
||||
newList.add(oldMap);
|
||||
}
|
||||
}
|
||||
return newList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待办列表
|
||||
*
|
||||
* @param searchQuery
|
||||
* @return
|
||||
*/
|
||||
public PageResultModel findRecordList(SearchQuery searchQuery) {
|
||||
// TODO Auto-generated method stub
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getRecordList(searchQuery);
|
||||
} catch (Exception ex) {
|
||||
log.error("findRecordList===" + JSON.toJSONString(searchQuery), ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待办列表
|
||||
*
|
||||
* @param searchQuery
|
||||
* @return
|
||||
*/
|
||||
public WorkFlowPageVo findToDoList(SearchQuery searchQuery) {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
WorkFlowPageVo pageVo = new WorkFlowPageVo();
|
||||
try {
|
||||
// 所属流程平台租户
|
||||
searchQuery.setTenantId(bpmcConfig.getTenantId());
|
||||
searchQuery.setRecUserId(SecurityUtils.getUsername());
|
||||
|
||||
PageResultModel pageResultModel = bpmClient.getRecordList(searchQuery);
|
||||
pageVo.setPageSize(pageResultModel.getPageSize());
|
||||
pageVo.setPageNumber(pageResultModel.getThisPageNumber());
|
||||
pageVo.setTotalCount(pageResultModel.getTotalCount());
|
||||
List<WorkFlowInfo> workFlowInfos = JSONUtil.toList(JSONUtil.toJsonStr(pageResultModel.getResult()), WorkFlowInfo.class);
|
||||
pageVo.setResult(workFlowInfos);
|
||||
return pageVo;
|
||||
} catch (Exception ex) {
|
||||
log.error("findRecordList===" + JSON.toJSONString(searchQuery), ex);
|
||||
}
|
||||
return pageVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一环节定义
|
||||
*
|
||||
* @param searchQuery
|
||||
* @return
|
||||
*/
|
||||
public List<ActivityDefinitionModel> getNextActs(SearchQuery searchQuery) {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
List<ActivityDefinitionModel> actDefList = Lists.newArrayList();
|
||||
try {
|
||||
List<ActivityDefinitionModel> nextacts = bpmClient.getNextacts(searchQuery);
|
||||
|
||||
for (ActivityDefinitionModel activityDefinitionModel : nextacts) {
|
||||
activityDefinitionModel.setShowTxlSelect("N");
|
||||
// 流程平台如果有输出线名称 返回当前环节名称自动为输出线名称 由于其他业务系统已经使用 该处做特殊处理 (不读输出线名称)
|
||||
/*
|
||||
* if (StrUtil.isNotBlank(activityDefinitionModel.getDescription())) {
|
||||
* // 描述名称 为流程平台返回的当前环节名称
|
||||
* activityDefinitionModel.setActDefName(activityDefinitionModel.getDescription(
|
||||
* ));
|
||||
* }
|
||||
*/
|
||||
if (END_ACT_NAME.equalsIgnoreCase(activityDefinitionModel.getActDefName())) {
|
||||
actDefList.add(activityDefinitionModel);
|
||||
continue;
|
||||
}
|
||||
List<ExtAttributeModel> extAttrlist = bpmClient.getActDefExtAttrs(searchQuery.getProcDefId(),
|
||||
activityDefinitionModel.getActDefId());
|
||||
for (ExtAttributeModel extMap : extAttrlist) {
|
||||
// 根据流程环节自定义标签判断是否显示“通讯录选择人员”按钮
|
||||
if (SHOW_TXL_SELECT.equalsIgnoreCase(extMap.getObjKey().trim())) {
|
||||
activityDefinitionModel.setShowTxlSelect(extMap.getObjValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
actDefList.add(activityDefinitionModel);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("获取下一步环节定义列表失败,参数:" + JSON.toJSONString(searchQuery), e);
|
||||
}
|
||||
|
||||
return actDefList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下一环节用户信息
|
||||
*
|
||||
* @param searchQuery
|
||||
* @return
|
||||
*/
|
||||
public List<ActivityResourceModel> getNextActUsers(SearchQuery searchQuery) {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
List<ActivityResourceModel> nextactUsers = Lists.newArrayList();
|
||||
try {
|
||||
nextactUsers = bpmClient.getNextactUsers(searchQuery);
|
||||
} catch (Exception e) {
|
||||
log.error("获取下一步环节用户列表失败,参数:" + JSON.toJSONString(searchQuery), e);
|
||||
}
|
||||
return nextactUsers;
|
||||
}
|
||||
|
||||
|
||||
public List<ExtAttributeModel> getExtAttributeModel(String procDefId, String actDefId) {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
List<ExtAttributeModel> list = Lists.newArrayList();
|
||||
try {
|
||||
list = bpmClient.getActDefExtAttrs(procDefId, actDefId);
|
||||
} catch (Exception e) {
|
||||
log.error("获取扩展属性失败", e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断下一环节是否支持自动提交
|
||||
*
|
||||
* @param searchQuery
|
||||
* @return
|
||||
*/
|
||||
public String checkAutoCommit(SearchQuery searchQuery) throws Exception {
|
||||
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
|
||||
try {
|
||||
String actDefId = "";
|
||||
String procDefId = "";
|
||||
// 待办提交
|
||||
if (StrUtil.isNotBlank(searchQuery.getCurActInstId())) {
|
||||
ActivitiInstanceModel activitiInstanceModel = bpmClient
|
||||
.getActivityInstance(searchQuery.getCurActInstId());
|
||||
actDefId = activitiInstanceModel.getActDefId();
|
||||
procDefId = activitiInstanceModel.getProcDefId();
|
||||
} else { // 新建提交
|
||||
ActivityDefinitionModel activityDefinitionModel = bpmClient.getActDef(searchQuery.getProcDefId(),
|
||||
searchQuery.getCurActDefId());
|
||||
actDefId = activityDefinitionModel.getActDefId();
|
||||
procDefId = activityDefinitionModel.getProcDefId();
|
||||
}
|
||||
List<ActivityDefinitionModel> netxtActDefList = bpmClient.getNextacts(searchQuery);
|
||||
if (netxtActDefList != null && netxtActDefList.size() == 1) {
|
||||
ActivityDefinitionModel netxtActDef = netxtActDefList.get(0);
|
||||
ActivityDefinitionModel actDef = bpmClient.getActDef(procDefId, actDefId);
|
||||
if (("auto".equalsIgnoreCase(actDef.getJumpType()) || netxtActDef.isNotSelectReceiver()
|
||||
|| "endEvent".equals(netxtActDef.getActDefType()))) {
|
||||
return netxtActDef.getActDefId();
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("checkAutoCommit==" + JSON.toJSONString(searchQuery), ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取第一个环节定义信息
|
||||
*
|
||||
* @param procDefId
|
||||
* @return
|
||||
*/
|
||||
public ActivityDefinitionModel getStartactDef(String procDefId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getStartactDef(procDefId);
|
||||
} catch (Exception ex) {
|
||||
// TODO Auto-generated catch block
|
||||
log.error("getStartactDef==" + procDefId, ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取环节定义信息
|
||||
* @param procDefId 流程定义Id
|
||||
* @param actDefId 环节定义Id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public ActivityDefinitionModel getActDef(String procDefId,String actDefId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getActDef(procDefId, actDefId);
|
||||
} catch (Exception ex) {
|
||||
// TODO Auto-generated catch block
|
||||
log.error("getActDef==" + procDefId+"===="+actDefId, ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取环节定义信息
|
||||
* @param procDefId 流程定义Id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<ActivityDefinitionModel> getActDef(String procDefId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getActDef(procDefId);
|
||||
} catch (Exception ex) {
|
||||
log.error("getActDef==" + procDefId, ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程定义Key获取流程定义信息
|
||||
*
|
||||
* @param procDefKey
|
||||
* @return
|
||||
*/
|
||||
public ProcessDefinitionModel getProcessDefinitionModel(String procDefKey) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getProcessDef(procDefKey);
|
||||
} catch (Exception ex) {
|
||||
// TODO Auto-generated catch block
|
||||
log.error("getProcessDefinitionModel==" + procDefKey, ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public String getHistasklogurl(String procInstId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
Map<String, String> param = bpmClient.getHistoryUrl(procInstId);
|
||||
return param.get("url");
|
||||
} catch (Exception ex) {
|
||||
log.error("getHistasklogurl==" + ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public String getImageUrl(String procDefId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
Map<String, String> param = bpmClient.getImageUrl(procDefId);
|
||||
return param.get("url");
|
||||
} catch (Exception ex) {
|
||||
log.error("getImageUrl==" + ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程实例状态
|
||||
*
|
||||
* @param procInstId
|
||||
* @param curActInstId
|
||||
* @return
|
||||
*/
|
||||
public int getFlowStatus(String procInstId, String curActInstId) {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
ActivitiInstanceModel actInstMap = bpmClient.getActivityInstance(curActInstId);
|
||||
if (actInstMap != null && actInstMap.getFinishTime() != null && actInstMap.getFinishTime().length() > 0) {
|
||||
ProcessInstanceModel procInst = bpmClient.getProcessInstById(procInstId);
|
||||
if (procInst != null && procInst.getFinishTime() != null) {
|
||||
return FLOW_STATUS_FINISH;
|
||||
}
|
||||
return FLOW_STATUS_READ;
|
||||
}
|
||||
return FLOW_STATUS_UNREAD;
|
||||
} catch (Exception ex) {
|
||||
log.error("getFlowStatus===procInstId=" + procInstId + ",curActInstId==" + curActInstId, ex);
|
||||
}
|
||||
return FLOW_STATUS_ERROR;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程实例状态,并判断当前用户是否有权限打开待办
|
||||
*
|
||||
* @param procInstId
|
||||
* @param curActInstId
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public ProcessInstanceModel getProcessInstance(String procInstId, String curActInstId,
|
||||
String userId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
ProcessInstanceModel procInst = null;
|
||||
ActivitiInstanceModel actInst = bpmClient.getActivityInstance(curActInstId);
|
||||
if (actInst == null || !StrUtil.equals(actInst.getReceiverUserId(), userId)) {
|
||||
throw new Exception("没有找到环节实例");
|
||||
}
|
||||
procInst = bpmClient.getProcessInstById(procInstId);
|
||||
procInst.setCurrentActivitiInstance(actInst);
|
||||
Map<String, String> formUrlMap = getFlowActForm(procInst.getProcDefId(), actInst.getActDefId());
|
||||
if (formUrlMap.containsKey("formUrl")) {
|
||||
procInst.setFormUrl(formUrlMap.get("formUrl"));
|
||||
}
|
||||
procInst.setProcInstState(FLOW_STATUS_ERROR + "");
|
||||
if (actInst.getFinishTime() == null || actInst.getFinishTime().length() == 0) {
|
||||
procInst.setProcInstState(FLOW_STATUS_UNREAD + "");
|
||||
return procInst;
|
||||
}
|
||||
if (procInst.getFinishTime() != null) {
|
||||
procInst.setProcInstState(FLOW_STATUS_FINISH + "");
|
||||
} else {
|
||||
procInst.setProcInstState(FLOW_STATUS_READ + "");
|
||||
}
|
||||
return procInst;
|
||||
}
|
||||
|
||||
public Map<String, String> getFlowActForm(String procDefId, String actDefId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
Map<String, String> result = new HashMap<>();
|
||||
try {
|
||||
ActivityDefinitionModel act = bpmClient.getActDef(procDefId, actDefId);
|
||||
result.put("formUrl", act.getPageUrl());
|
||||
result.put("appFormUrl", act.getMportalUrl());
|
||||
} catch (Exception ex) {
|
||||
log.error("getFlowActForm==" + ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> getProcessInstById(String procInstId) {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
ProcessInstanceModel procInst = null;
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
procInst = bpmClient.getProcessInstById(procInstId);
|
||||
result = BeanUtil.beanToMap(procInst);
|
||||
Map<String, Object> curActInfo = this.getCurActInfo(procInstId);
|
||||
result.put("curActInstId", curActInfo.get("curActInstId").toString());
|
||||
result.put("curActDefId", curActInfo.get("curActDefId").toString());
|
||||
result.put("curActDefName", curActInfo.get("curActDefName").toString());
|
||||
result.put("prevActDefId", curActInfo.get("prevActDefId").toString());
|
||||
|
||||
result.put("sendUserId", curActInfo.get("receiveUserId").toString());
|
||||
result.put("sendUserOrgId", curActInfo.get("receiveOrgId").toString());
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Map<String, Object> getCurActInfo(String procInstId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
// 根据流程实例id获取流程实例日志
|
||||
String logStr = bpmClient.getProcInstLog(procInstId);
|
||||
List<Map<String, Object>> procLog = new ArrayList<Map<String, Object>>();
|
||||
Map<String, Object> procInstLog = JSONObject.parseObject(logStr, Map.class);
|
||||
if (null != procInstLog && procInstLog.containsKey("procLogs")) {
|
||||
// 获取日志实例
|
||||
procLog = (List<Map<String, Object>>) procInstLog.get("procLogs");
|
||||
for (Map<String, Object> map : procLog) {
|
||||
if (null == map.get("endTime")) {
|
||||
if ("pms_zhsqlc-03".equals(map.get("prevActDefId"))) {
|
||||
result = map;
|
||||
} else {
|
||||
result = map;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Map<String, Object> procInstInfoAndStatus(String procInstId) {
|
||||
Map<String, Object> procInst = this.getProcessInstById(procInstId);
|
||||
int status = 0;
|
||||
try {
|
||||
status = this.getFlowStatus(procInstId, procInst.get("curActInstId").toString());
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
procInst.put("status", status + "");
|
||||
return procInst;
|
||||
}
|
||||
|
||||
public Map<String, Object> checkAutoJump(SearchQuery searchQuery) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
ActivityDefinitionModel actDef = new ActivityDefinitionModel();
|
||||
try {
|
||||
String actDefId = "";
|
||||
String procDefId = "";
|
||||
// 待办提交
|
||||
if (StrUtil.isNotBlank(searchQuery.getCurActInstId())) {
|
||||
ActivitiInstanceModel activitiInstanceModel = bpmClient
|
||||
.getActivityInstance(searchQuery.getCurActInstId());
|
||||
actDefId = activitiInstanceModel.getActDefId();
|
||||
procDefId = activitiInstanceModel.getProcDefId();
|
||||
actDef = bpmClient.getActDef(procDefId, actDefId);
|
||||
} else { // 新建提交
|
||||
actDef = bpmClient.getActDef(searchQuery.getProcDefId(), searchQuery.getCurActDefId());
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
if ("auto".equalsIgnoreCase(actDef.getJumpType())) {
|
||||
result.put("flag", true);
|
||||
} else {
|
||||
result.put("flag", false);
|
||||
}
|
||||
return result;
|
||||
} catch (Exception ex) {
|
||||
log.error("checkAutoCommit==" + JSON.toJSONString(searchQuery), ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Integer> getRecordCount(SearchQuery searchQuery) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getRecordCount(searchQuery);
|
||||
} catch (Exception ex) {
|
||||
log.error("getRecordCount==" + JSON.toJSONString(searchQuery), ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父流程实例id获取该流程的子流程,从而处理子流程。
|
||||
*
|
||||
* @param procInstId 父流程实例id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<Map<String, Object>> getSubprocess(String status, String procInstId) throws Exception {
|
||||
BpmClient bpmClient = getBpmClient();
|
||||
try {
|
||||
return bpmClient.getSubprocess(status, procInstId);
|
||||
} catch (Exception ex) {
|
||||
log.error("getSubprocess==" + procInstId, ex);
|
||||
throw new Exception(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isYiBanTaskByTopId(String procInstId, String sourceActId, String targerActId) throws Exception {
|
||||
return getBpmClient().isYiBanTaskByTopId(procInstId,sourceActId,targerActId);
|
||||
}
|
||||
|
||||
public boolean isYiBanTask(String procInstId, String sourceActId, String targerActId) throws Exception {
|
||||
return getBpmClient().isYiBanTask(procInstId,sourceActId,targerActId);
|
||||
}
|
||||
|
||||
|
||||
public JSONArray getRecordbyPorcInstId(String porcInstId) throws Exception {
|
||||
WorkflowConfig workflowConfig = new WorkflowConfig();
|
||||
String url = String.format("%s/%s?procInstId=%s", bpmcConfig.getServiceUrl(), workflowConfig.getRecordQueryUrl(), porcInstId);
|
||||
return JSONArray.parseArray(getBpmClient().get(url));
|
||||
}
|
||||
}
|
@ -34,6 +34,11 @@ public class ToolServiceImpl implements IToolService
|
||||
return toolMapper.selectToolByToolId(toolId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Tool getInfoByBpmcId(String bpmcId){
|
||||
return toolMapper.getInfoByBpmcId(bpmcId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工具信息列表
|
||||
*
|
||||
@ -56,7 +61,6 @@ public class ToolServiceImpl implements IToolService
|
||||
public int insertTool(Tool tool)
|
||||
{
|
||||
tool.setCreateTime(DateUtils.getNowDate());
|
||||
tool.setToolId(IdUtil.simpleUUID());
|
||||
return toolMapper.insertTool(tool);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,110 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.rzdata.web.mapper.UseApplyItemMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.rzdata.web.mapper.UseApplyItemMapper;
|
||||
import com.rzdata.web.domain.UseApplyItem;
|
||||
import com.rzdata.web.service.IUseApplyItemService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 使用申请详情Service业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class UseApplyItemServiceImpl implements IUseApplyItemService
|
||||
{
|
||||
@Autowired
|
||||
private UseApplyItemMapper useApplyItemMapper;
|
||||
|
||||
/**
|
||||
* 查询使用申请详情
|
||||
*
|
||||
* @param id 使用申请详情主键
|
||||
* @return 使用申请详情
|
||||
*/
|
||||
@Override
|
||||
public UseApplyItem selectUseApplyItemById(String id)
|
||||
{
|
||||
return useApplyItemMapper.selectUseApplyItemById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询使用申请详情列表
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 使用申请详情
|
||||
*/
|
||||
@Override
|
||||
public List<UseApplyItem> selectUseApplyItemList(UseApplyItem useApplyItem)
|
||||
{
|
||||
return useApplyItemMapper.selectUseApplyItemList(useApplyItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请详情
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUseApplyItem(UseApplyItem useApplyItem)
|
||||
{
|
||||
return useApplyItemMapper.insertUseApplyItem(useApplyItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请详情
|
||||
*
|
||||
* @param useApplyItem 使用申请详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUseApplyItem(UseApplyItem useApplyItem)
|
||||
{
|
||||
return useApplyItemMapper.updateUseApplyItem(useApplyItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除使用申请详情
|
||||
*
|
||||
* @param ids 需要删除的使用申请详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUseApplyItemByIds(String[] ids)
|
||||
{
|
||||
return useApplyItemMapper.deleteUseApplyItemByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请详情信息
|
||||
*
|
||||
* @param id 使用申请详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUseApplyItemById(String id)
|
||||
{
|
||||
return useApplyItemMapper.deleteUseApplyItemById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateItemList(List<UseApplyItem> list, String applyId){
|
||||
useApplyItemMapper.deleteByApplyId(applyId);
|
||||
if (list!=null&&list.size()>0) {
|
||||
for (UseApplyItem item: list) {
|
||||
item.setApplyId(applyId);
|
||||
item.setId(IdUtil.simpleUUID());
|
||||
useApplyItemMapper.insertUseApplyItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.web.domain.Tool;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.rzdata.web.mapper.UseApplyMapper;
|
||||
import com.rzdata.web.domain.UseApply;
|
||||
import com.rzdata.web.service.IUseApplyService;
|
||||
|
||||
/**
|
||||
* 使用申请Service业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class UseApplyServiceImpl implements IUseApplyService
|
||||
{
|
||||
@Autowired
|
||||
private UseApplyMapper useApplyMapper;
|
||||
|
||||
/**
|
||||
* 查询使用申请
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 使用申请
|
||||
*/
|
||||
@Override
|
||||
public UseApply selectUseApplyById(String id)
|
||||
{
|
||||
return useApplyMapper.selectUseApplyById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UseApply getInfoByBpmcId(String bpmcId){
|
||||
return useApplyMapper.getInfoByBpmcId(bpmcId);
|
||||
}
|
||||
/**
|
||||
* 查询使用申请列表
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 使用申请
|
||||
*/
|
||||
@Override
|
||||
public List<UseApply> selectUseApplyList(UseApply useApply)
|
||||
{
|
||||
return useApplyMapper.selectUseApplyList(useApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUseApply(UseApply useApply)
|
||||
{
|
||||
useApply.setCreateTime(DateUtils.getNowDate());
|
||||
return useApplyMapper.insertUseApply(useApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改使用申请
|
||||
*
|
||||
* @param useApply 使用申请
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUseApply(UseApply useApply)
|
||||
{
|
||||
useApply.setUpdateTime(DateUtils.getNowDate());
|
||||
return useApplyMapper.updateUseApply(useApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除使用申请
|
||||
*
|
||||
* @param ids 需要删除的使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUseApplyByIds(String[] ids)
|
||||
{
|
||||
return useApplyMapper.deleteUseApplyByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除使用申请信息
|
||||
*
|
||||
* @param id 使用申请主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUseApplyById(String id)
|
||||
{
|
||||
return useApplyMapper.deleteUseApplyById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
package com.rzdata.web.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.blueland.bpmclient.model.BpmClientInputModel;
|
||||
import com.blueland.bpmclient.model.ProcessInstanceModel;
|
||||
import com.rzdata.common.utils.DateUtils;
|
||||
import com.rzdata.web.domain.bo.BpmClientInputModelBo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.rzdata.web.mapper.WorkflowLogMapper;
|
||||
import com.rzdata.web.domain.WorkflowLog;
|
||||
import com.rzdata.web.service.IWorkflowLogService;
|
||||
|
||||
/**
|
||||
* 流程审批记录Service业务层处理
|
||||
*
|
||||
* @author ja
|
||||
* @date 2024-08-21
|
||||
*/
|
||||
@Service
|
||||
public class WorkflowLogServiceImpl implements IWorkflowLogService
|
||||
{
|
||||
@Autowired
|
||||
private WorkflowLogMapper workflowLogMapper;
|
||||
|
||||
/**
|
||||
* 查询流程审批记录
|
||||
*
|
||||
* @param id 流程审批记录主键
|
||||
* @return 流程审批记录
|
||||
*/
|
||||
@Override
|
||||
public WorkflowLog selectWorkflowLogById(String id)
|
||||
{
|
||||
return workflowLogMapper.selectWorkflowLogById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程审批记录列表
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 流程审批记录
|
||||
*/
|
||||
@Override
|
||||
public List<WorkflowLog> selectWorkflowLogList(WorkflowLog workflowLog)
|
||||
{
|
||||
return workflowLogMapper.selectWorkflowLogList(workflowLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程审批记录
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWorkflowLog(WorkflowLog workflowLog)
|
||||
{
|
||||
workflowLog.setCreateTime(DateUtils.getNowDate());
|
||||
return workflowLogMapper.insertWorkflowLog(workflowLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流程审批记录
|
||||
*
|
||||
* @param workflowLog 流程审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWorkflowLog(WorkflowLog workflowLog)
|
||||
{
|
||||
workflowLog.setUpdateTime(DateUtils.getNowDate());
|
||||
return workflowLogMapper.updateWorkflowLog(workflowLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除流程审批记录
|
||||
*
|
||||
* @param ids 需要删除的流程审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWorkflowLogByIds(String[] ids)
|
||||
{
|
||||
return workflowLogMapper.deleteWorkflowLogByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程审批记录信息
|
||||
*
|
||||
* @param id 流程审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWorkflowLogById(String id)
|
||||
{
|
||||
return workflowLogMapper.deleteWorkflowLogById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveProcLog(BpmClientInputModelBo bpmClientInputModelBo, ProcessInstanceModel processInst, String action){
|
||||
BpmClientInputModel bpmClientInputModel = bpmClientInputModelBo.getModel();
|
||||
WorkflowLog workflowLog = new WorkflowLog();
|
||||
workflowLog.setId(IdUtil.simpleUUID());
|
||||
workflowLog.setPass(bpmClientInputModelBo.getApplyStatus());
|
||||
workflowLog.setProcInstId(processInst.getProcInstId());
|
||||
workflowLog.setBusinessId(processInst.getBusinessKey());
|
||||
workflowLog.setActDefId(bpmClientInputModel.getWf_curActDefId());
|
||||
workflowLog.setActDefName(bpmClientInputModel.getWf_curActDefName());
|
||||
workflowLog.setNextDefId(bpmClientInputModel.getWf_nextActDefId());
|
||||
workflowLog.setNextDefName(bpmClientInputModel.getWf_nextActDefName());
|
||||
workflowLog.setActInstId(bpmClientInputModel.getWf_curActInstId());
|
||||
workflowLog.setOpinion(bpmClientInputModel.getWf_curComment());
|
||||
workflowLog.setSender(bpmClientInputModel.getWf_sendUserId());
|
||||
workflowLog.setSenderDeptId(bpmClientInputModel.getWf_sendUserOrgId());
|
||||
workflowLog.setReceiver(JSONUtil.toJsonStr(bpmClientInputModel.getWf_receivers()));
|
||||
workflowLog.setActStatus(action);
|
||||
workflowLog.setProcDefKey(bpmClientInputModel.getWf_procDefKey());
|
||||
workflowLog.setReview(bpmClientInputModelBo.getReview());
|
||||
workflowLogMapper.insertWorkflowLog(workflowLog);
|
||||
}
|
||||
}
|
@ -127,3 +127,8 @@ xss:
|
||||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
bpmc:
|
||||
tenantId: TLTC_SYS
|
||||
serviceUrl: http://192.168.2.17:8081/ebpm-process-rest/
|
||||
uniteWorkUrl: http://localhost/tool-tech/workflowRouter
|
||||
|
@ -24,6 +24,8 @@
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="procInstId" column="proc_inst_id" />
|
||||
<result property="recordStatus" column="record_status" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
</resultMap>
|
||||
|
||||
@ -38,7 +40,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectToolVo">
|
||||
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, status, remark, create_by, create_time, update_by, update_time from t_tool
|
||||
select tool_id, tool_code, tool_name, tool_type, tool_source, tool_use, test_situation, function_desc, apply_condition, operate_explain, tool_principals, tool_principals_name, tool_resp_dept, status, remark, create_by, create_time, update_by, update_time,proc_inst_id,record_status from t_tool
|
||||
</sql>
|
||||
|
||||
<select id="selectToolByToolId" parameterType="String" resultMap="ToolResult">
|
||||
@ -46,6 +48,11 @@
|
||||
where tool_id = #{toolId}
|
||||
</select>
|
||||
|
||||
<select id="getInfoByBpmcId" parameterType="String" resultMap="ToolResult">
|
||||
<include refid="selectToolVo"/>
|
||||
where proc_inst_id = #{bpmcId}
|
||||
</select>
|
||||
|
||||
<insert id="insertTool" parameterType="Tool">
|
||||
insert into t_tool
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@ -68,6 +75,8 @@
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="procInstId != null">proc_inst_id,</if>
|
||||
<if test="recordStatus != null">record_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="toolId != null">#{toolId},</if>
|
||||
@ -89,12 +98,15 @@
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="procInstId != null">#{procInstId},</if>
|
||||
<if test="recordStatus != null">#{recordStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTool" parameterType="Tool">
|
||||
update t_tool
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="toolCode != null">tool_code = #{toolCode},</if>
|
||||
<if test="toolName != null">tool_name = #{toolName},</if>
|
||||
<if test="toolType != null">tool_type = #{toolType},</if>
|
||||
<if test="toolSource != null">tool_source = #{toolSource},</if>
|
||||
@ -112,6 +124,7 @@
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="recordStatus != null">record_status = #{recordStatus},</if>
|
||||
</trim>
|
||||
where tool_id = #{toolId}
|
||||
</update>
|
||||
@ -154,4 +167,4 @@
|
||||
#{toolId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
@ -0,0 +1,97 @@
|
||||
<?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.rzdata.web.mapper.UseApplyItemMapper">
|
||||
|
||||
<resultMap type="UseApplyItem" id="UseApplyItemResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="applyId" column="apply_id" />
|
||||
<result property="toolId" column="tool_id" />
|
||||
<result property="toolCode" column="tool_code" />
|
||||
<result property="toolName" column="tool_name" />
|
||||
<result property="toolType" column="tool_type" />
|
||||
<result property="toolPrincipals" column="tool_principals" />
|
||||
<result property="toolPrincipalsName" column="tool_principals_name" />
|
||||
<result property="toolRespDept" column="tool_resp_dept" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUseApplyItemVo">
|
||||
select id, apply_id, tool_id, tool_code, tool_name, tool_type, tool_principals, tool_principals_name, tool_resp_dept from t_use_apply_item
|
||||
</sql>
|
||||
|
||||
<select id="selectUseApplyItemList" parameterType="UseApplyItem" resultMap="UseApplyItemResult">
|
||||
<include refid="selectUseApplyItemVo"/>
|
||||
<where>
|
||||
<if test="applyId != null and applyId != ''"> and apply_id = #{applyId}</if>
|
||||
<if test="toolId != null and toolId != ''"> and tool_id = #{toolId}</if>
|
||||
<if test="toolCode != null and toolCode != ''"> and tool_code = #{toolCode}</if>
|
||||
<if test="toolName != null and toolName != ''"> and tool_name like concat('%', #{toolName}, '%')</if>
|
||||
<if test="toolType != null and toolType != ''"> and tool_type = #{toolType}</if>
|
||||
<if test="toolPrincipals != null and toolPrincipals != ''"> and tool_principals = #{toolPrincipals}</if>
|
||||
<if test="toolPrincipalsName != null and toolPrincipalsName != ''"> and tool_principals_name like concat('%', #{toolPrincipalsName}, '%')</if>
|
||||
<if test="toolRespDept != null and toolRespDept != ''"> and tool_resp_dept = #{toolRespDept}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUseApplyItemById" parameterType="String" resultMap="UseApplyItemResult">
|
||||
<include refid="selectUseApplyItemVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertUseApplyItem" parameterType="UseApplyItem">
|
||||
insert into t_use_apply_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="applyId != null">apply_id,</if>
|
||||
<if test="toolId != null">tool_id,</if>
|
||||
<if test="toolCode != null">tool_code,</if>
|
||||
<if test="toolName != null">tool_name,</if>
|
||||
<if test="toolType != null">tool_type,</if>
|
||||
<if test="toolPrincipals != null">tool_principals,</if>
|
||||
<if test="toolPrincipalsName != null">tool_principals_name,</if>
|
||||
<if test="toolRespDept != null">tool_resp_dept,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="applyId != null">#{applyId},</if>
|
||||
<if test="toolId != null">#{toolId},</if>
|
||||
<if test="toolCode != null">#{toolCode},</if>
|
||||
<if test="toolName != null">#{toolName},</if>
|
||||
<if test="toolType != null">#{toolType},</if>
|
||||
<if test="toolPrincipals != null">#{toolPrincipals},</if>
|
||||
<if test="toolPrincipalsName != null">#{toolPrincipalsName},</if>
|
||||
<if test="toolRespDept != null">#{toolRespDept},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUseApplyItem" parameterType="UseApplyItem">
|
||||
update t_use_apply_item
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="applyId != null">apply_id = #{applyId},</if>
|
||||
<if test="toolId != null">tool_id = #{toolId},</if>
|
||||
<if test="toolCode != null">tool_code = #{toolCode},</if>
|
||||
<if test="toolName != null">tool_name = #{toolName},</if>
|
||||
<if test="toolType != null">tool_type = #{toolType},</if>
|
||||
<if test="toolPrincipals != null">tool_principals = #{toolPrincipals},</if>
|
||||
<if test="toolPrincipalsName != null">tool_principals_name = #{toolPrincipalsName},</if>
|
||||
<if test="toolRespDept != null">tool_resp_dept = #{toolRespDept},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUseApplyItemById" parameterType="String">
|
||||
delete from t_use_apply_item where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUseApplyItemByIds" parameterType="String">
|
||||
delete from t_use_apply_item where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByApplyId" parameterType="String">
|
||||
delete from t_use_apply_item where apply_id = #{applyId}
|
||||
</delete>
|
||||
</mapper>
|
96
tool-tech-admin/src/main/resources/mapper/UseApplyMapper.xml
Normal file
96
tool-tech-admin/src/main/resources/mapper/UseApplyMapper.xml
Normal file
@ -0,0 +1,96 @@
|
||||
<?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.rzdata.web.mapper.UseApplyMapper">
|
||||
|
||||
<resultMap type="UseApply" id="UseApplyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="reason" column="reason" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="procInstId" column="proc_inst_id" />
|
||||
<result property="recordStatus" column="record_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUseApplyVo">
|
||||
select id, user_name, dept_id, reason, create_by, create_time, update_by, update_time from t_use_apply
|
||||
</sql>
|
||||
|
||||
<select id="selectUseApplyList" parameterType="UseApply" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
<where>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
|
||||
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUseApplyById" parameterType="String" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getInfoByBpmcId" parameterType="String" resultMap="UseApplyResult">
|
||||
<include refid="selectUseApplyVo"/>
|
||||
where proc_inst_id = #{bpmcId}
|
||||
</select>
|
||||
|
||||
<insert id="insertUseApply" parameterType="UseApply">
|
||||
insert into t_use_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="reason != null">reason,</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="procInstId != null">proc_inst_id,</if>
|
||||
<if test="recordStatus != null">record_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="reason != null">#{reason},</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="procInstId != null">#{procInstId},</if>
|
||||
<if test="recordStatus != null">#{recordStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateUseApply" parameterType="UseApply">
|
||||
update t_use_apply
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="reason != null">reason = #{reason},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="recordStatus != null">record_status = #{recordStatus},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUseApplyById" parameterType="String">
|
||||
delete from t_use_apply where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUseApplyByIds" parameterType="String">
|
||||
delete from t_use_apply where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
147
tool-tech-admin/src/main/resources/mapper/WorkflowLogMapper.xml
Normal file
147
tool-tech-admin/src/main/resources/mapper/WorkflowLogMapper.xml
Normal file
@ -0,0 +1,147 @@
|
||||
<?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.rzdata.web.mapper.WorkflowLogMapper">
|
||||
|
||||
<resultMap type="WorkflowLog" id="WorkflowLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="procInstId" column="proc_inst_id" />
|
||||
<result property="procDefKey" column="proc_def_key" />
|
||||
<result property="businessId" column="business_id" />
|
||||
<result property="actDefId" column="act_def_id" />
|
||||
<result property="actDefName" column="act_def_name" />
|
||||
<result property="nextDefId" column="next_def_id" />
|
||||
<result property="nextDefName" column="next_def_name" />
|
||||
<result property="actInstId" column="act_inst_id" />
|
||||
<result property="opinion" column="opinion" />
|
||||
<result property="sender" column="sender" />
|
||||
<result property="senderDeptId" column="sender_dept_id" />
|
||||
<result property="receiver" column="receiver" />
|
||||
<result property="actStatus" column="act_status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="pass" column="pass" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="review" column="review" />
|
||||
<result property="batch" column="batch" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWorkflowLogVo">
|
||||
select id, proc_inst_id, proc_def_key, business_id, act_def_id, act_def_name, next_def_id, next_def_name, act_inst_id, opinion, sender, sender_dept_id, receiver, act_status, create_time, update_time, pass, tenant_id, review, batch from t_workflow_log
|
||||
</sql>
|
||||
|
||||
<select id="selectWorkflowLogList" parameterType="WorkflowLog" resultMap="WorkflowLogResult">
|
||||
<include refid="selectWorkflowLogVo"/>
|
||||
<where>
|
||||
<if test="procInstId != null and procInstId != ''"> and proc_inst_id = #{procInstId}</if>
|
||||
<if test="procDefKey != null and procDefKey != ''"> and proc_def_key = #{procDefKey}</if>
|
||||
<if test="businessId != null and businessId != ''"> and business_id = #{businessId}</if>
|
||||
<if test="actDefId != null and actDefId != ''"> and act_def_id = #{actDefId}</if>
|
||||
<if test="actDefName != null and actDefName != ''"> and act_def_name like concat('%', #{actDefName}, '%')</if>
|
||||
<if test="nextDefId != null and nextDefId != ''"> and next_def_id = #{nextDefId}</if>
|
||||
<if test="nextDefName != null and nextDefName != ''"> and next_def_name like concat('%', #{nextDefName}, '%')</if>
|
||||
<if test="actInstId != null and actInstId != ''"> and act_inst_id = #{actInstId}</if>
|
||||
<if test="opinion != null and opinion != ''"> and opinion = #{opinion}</if>
|
||||
<if test="sender != null and sender != ''"> and sender = #{sender}</if>
|
||||
<if test="senderDeptId != null and senderDeptId != ''"> and sender_dept_id = #{senderDeptId}</if>
|
||||
<if test="receiver != null and receiver != ''"> and receiver = #{receiver}</if>
|
||||
<if test="actStatus != null and actStatus != ''"> and act_status = #{actStatus}</if>
|
||||
<if test="pass != null "> and pass = #{pass}</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if>
|
||||
<if test="review != null "> and review = #{review}</if>
|
||||
<if test="batch != null and batch != ''"> and batch = #{batch}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectWorkflowLogById" parameterType="String" resultMap="WorkflowLogResult">
|
||||
<include refid="selectWorkflowLogVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertWorkflowLog" parameterType="WorkflowLog">
|
||||
insert into t_workflow_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="procInstId != null">proc_inst_id,</if>
|
||||
<if test="procDefKey != null">proc_def_key,</if>
|
||||
<if test="businessId != null">business_id,</if>
|
||||
<if test="actDefId != null">act_def_id,</if>
|
||||
<if test="actDefName != null">act_def_name,</if>
|
||||
<if test="nextDefId != null">next_def_id,</if>
|
||||
<if test="nextDefName != null">next_def_name,</if>
|
||||
<if test="actInstId != null">act_inst_id,</if>
|
||||
<if test="opinion != null">opinion,</if>
|
||||
<if test="sender != null">sender,</if>
|
||||
<if test="senderDeptId != null">sender_dept_id,</if>
|
||||
<if test="receiver != null">receiver,</if>
|
||||
<if test="actStatus != null">act_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="pass != null">pass,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="review != null">review,</if>
|
||||
<if test="batch != null">batch,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="procInstId != null">#{procInstId},</if>
|
||||
<if test="procDefKey != null">#{procDefKey},</if>
|
||||
<if test="businessId != null">#{businessId},</if>
|
||||
<if test="actDefId != null">#{actDefId},</if>
|
||||
<if test="actDefName != null">#{actDefName},</if>
|
||||
<if test="nextDefId != null">#{nextDefId},</if>
|
||||
<if test="nextDefName != null">#{nextDefName},</if>
|
||||
<if test="actInstId != null">#{actInstId},</if>
|
||||
<if test="opinion != null">#{opinion},</if>
|
||||
<if test="sender != null">#{sender},</if>
|
||||
<if test="senderDeptId != null">#{senderDeptId},</if>
|
||||
<if test="receiver != null">#{receiver},</if>
|
||||
<if test="actStatus != null">#{actStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="pass != null">#{pass},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="review != null">#{review},</if>
|
||||
<if test="batch != null">#{batch},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWorkflowLog" parameterType="WorkflowLog">
|
||||
update t_workflow_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="procInstId != null">proc_inst_id = #{procInstId},</if>
|
||||
<if test="procDefKey != null">proc_def_key = #{procDefKey},</if>
|
||||
<if test="businessId != null">business_id = #{businessId},</if>
|
||||
<if test="actDefId != null">act_def_id = #{actDefId},</if>
|
||||
<if test="actDefName != null">act_def_name = #{actDefName},</if>
|
||||
<if test="nextDefId != null">next_def_id = #{nextDefId},</if>
|
||||
<if test="nextDefName != null">next_def_name = #{nextDefName},</if>
|
||||
<if test="actInstId != null">act_inst_id = #{actInstId},</if>
|
||||
<if test="opinion != null">opinion = #{opinion},</if>
|
||||
<if test="sender != null">sender = #{sender},</if>
|
||||
<if test="senderDeptId != null">sender_dept_id = #{senderDeptId},</if>
|
||||
<if test="receiver != null">receiver = #{receiver},</if>
|
||||
<if test="actStatus != null">act_status = #{actStatus},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="pass != null">pass = #{pass},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="review != null">review = #{review},</if>
|
||||
<if test="batch != null">batch = #{batch},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWorkflowLogById" parameterType="String">
|
||||
delete from t_workflow_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWorkflowLogByIds" parameterType="String">
|
||||
delete from t_workflow_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,49 @@
|
||||
package com.rzdata.common.enums;
|
||||
|
||||
|
||||
public enum RecordStatusEnum {
|
||||
|
||||
/**
|
||||
* 草稿
|
||||
*/
|
||||
DRAFT("draft","草稿"),
|
||||
|
||||
/**
|
||||
* 进行中
|
||||
*/
|
||||
DOING("doing","进行中"),
|
||||
|
||||
/**
|
||||
* 已完成
|
||||
*/
|
||||
DONE("done","已办结"),
|
||||
|
||||
/**
|
||||
* 作废
|
||||
*/
|
||||
CANCEL("cancel","已撤销");
|
||||
|
||||
RecordStatusEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static String getMsg(String code){
|
||||
for (RecordStatusEnum recordStatusEnum : RecordStatusEnum.values()){
|
||||
if(recordStatusEnum.getCode().equals(code)){
|
||||
return recordStatusEnum.getMsg();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user