DefVarController.java
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.hotent.bpmModel.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.hotent.base.annotation.NewVersion;
import com.hotent.base.controller.BaseController;
import com.hotent.bpmModel.manager.BpmDefVarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.base.model.CommonResult;
import com.hotent.bpm.api.model.process.def.BpmVariableDef;
import com.hotent.bpmModel.params.BpmVariableDefVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* 描述:流程变量管理
* @company 广州宏天软件有限公司
* @author wanghb
* @email wanghb@jee-soft.cn
* @date 2018年6月26日
*/
@RestController
@RequestMapping("/flow/var/v1/")
@Api(tags="流程变量")
@ApiGroup(group= {ApiGroupConsts.GROUP_BPM})
@NewVersion
public class DefVarController {
@Autowired
BpmDefVarService defVarService;
/**
* 流程变量列表数据
*/
@RequestMapping(value="listJson", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "流程变量列表数据", httpMethod = "GET", notes = "流程变量列表数据")
public List<BpmVariableDef> listJson(
@ApiParam(name="defId",value="常用语id")@RequestParam String defId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId) throws Exception {
List<BpmVariableDef> res=defVarService.listJson(defId,nodeId);
return res;
}
/**
* 编辑节点变量
*/
@RequestMapping(value="defVarEdit", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "编辑节点变量", httpMethod = "GET", notes = "编辑节点变量")
public Map<String,Object> defVarEdit(
@ApiParam(name="defId",value="常用语id")@RequestParam String defId,
@ApiParam(name="varKey",value="变量key")@RequestParam String varKey) throws Exception {
Map<String,Object> res=defVarService.defVarEdit(defId,varKey);
return res;
}
/**
* 删除节点变量
*/
@RequestMapping(value="remove",method=RequestMethod.DELETE, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "删除节点变量", httpMethod = "DELETE", notes = "删除节点变量")
public CommonResult<String> remove(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="varKey",value="变量key,支持','逗号分割批量删除", required = true) @RequestParam String varKey) throws Exception {
CommonResult<String> res=defVarService.remove(defId,varKey);
return res;
}
/**
* 保存节点规则
*/
@RequestMapping(value="save",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "保存节点规则", httpMethod = "POST", notes = "保存节点规则")
public CommonResult<String> save(
@ApiParam(name="variableDefVo",value="保存节点规则", required = true) @RequestBody BpmVariableDefVo variableDefVo) throws Exception {
CommonResult<String> res=defVarService.save(variableDefVo);
return res;
}
}