PluginsController.java
7.66 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package com.hotent.bpmModel.controller;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.annotation.NewVersion;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.base.model.CommonResult;
import com.hotent.bpm.api.model.process.nodedef.BpmNodeDef;
import com.hotent.bpm.api.service.BpmDefinitionAccessor;
import com.hotent.bpm.plugin.task.startnewflow.context.StartNewFlowPluginContext;
import com.hotent.bpmModel.manager.BpmPluginsService;
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/plugins/v1/")
@Api(tags="流程插件")
@ApiGroup(group= {ApiGroupConsts.GROUP_BPM})
@NewVersion
public class PluginsController {
@Resource
BpmDefinitionAccessor bpmDefinitionAccessor ;
@Autowired
private BpmPluginsService bpmPluginsService;
@RequestMapping(value="procNotifyEdit",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "获取编辑结束抄送页面数据", httpMethod = "GET", notes = "获取编辑结束抄送页面数据")
public String procNotifyEdit(@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId) throws Exception{
return bpmPluginsService.procNotifyEdit(defId);
}
/**
* 保存结束抄送
* @exception
* @since 1.0.0
*/
@RequestMapping(value="procNotifySave",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "保存结束抄送", httpMethod = "POST", notes = "保存结束抄送")
public CommonResult<String> procNotifySave(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="procNotifyJson",value="办结抄送的json数据", required = true) @RequestBody String procNotifyJson) throws Exception{
return bpmPluginsService.procNotifySave(defId,procNotifyJson);
}
/**
* 获取催办json
*/
@RequestMapping(value="remindersJson", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "获取催办json", httpMethod = "GET", notes = "获取催办json")
public Map<String,Object> remindersJson(@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId ) throws Exception{
return bpmPluginsService.remindersJson(defId,nodeId);
}
/**
* 保存结束抄送
* @exception
* @since 1.0.0
*/
@RequestMapping(value="remindersSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "保存结束抄送", httpMethod = "POST", notes = "保存结束抄送")
public CommonResult<String> remindersSave(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId,
@ApiParam(name="remindersJson",value="抄送json", required = true) @RequestBody String remindersJson) throws Exception{
return bpmPluginsService.reminderSave(defId,nodeId,remindersJson);
}
/**
* 获取测试插件json
*/
@RequestMapping(value="getTestPlugin", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "获取测试插件json", httpMethod = "GET", notes = "获取测试插件json")
public String getTestPlugin(@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId ) throws Exception{
return bpmPluginsService.getTestPlugin(defId,nodeId);
}
/**
* 保存测试插件
* @exception
* @since 1.0.0
*/
@RequestMapping(value="saveTestPlugin", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "保存测试插件", httpMethod = "POST", notes = "保存测试插件")
public CommonResult<String> saveTestPlugin(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId,
@ApiParam(name="json",value="json", required = true) @RequestBody String json) throws Exception{
return bpmPluginsService.saveTestPlugin(defId,nodeId,json);
}
/**
* 获取触发新流程配置
*/
@RequestMapping(value="startNewFlowJson", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "获取触发新流程json", httpMethod = "GET", notes = "获取触发新流程json")
public String startNewFlowJson(@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId ) throws Exception{
BpmNodeDef nodeDef = bpmDefinitionAccessor.getBpmNodeDef(defId, nodeId);
StartNewFlowPluginContext context=nodeDef.getPluginContext(StartNewFlowPluginContext.class);
return context!= null?context.getJson() : "";
}
/**
* 保存触发新流程配置
* @exception
* @since 1.0.0
*/
@RequestMapping(value="startNewFlowSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "保存结束抄送", httpMethod = "POST", notes = "保存结束抄送")
public CommonResult<String> startNewFlowSave(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId,
@ApiParam(name="json",value="配置json", required = true) @RequestBody String json) throws Exception{
return bpmPluginsService.startNewFlowSave(defId,nodeId,json);
}
/**
* 保存子流程发起设置插件
*
* @exception @since 1.0.0
*/
@RequestMapping(value = "saveSubProcessPlugin", method = RequestMethod.POST, produces = {
"application/json; charset=utf-8" })
@ApiOperation(value = "保存子流程发起设置插件", httpMethod = "POST", notes = "保存子流程发起设置插件")
public CommonResult<String> saveSubProcessPlugin(
@ApiParam(name = "defId", value = "流程定义id", required = true) @RequestParam String defId,
@ApiParam(name = "nodeId", value = "节点id", required = true) @RequestParam String nodeId,
@ApiParam(name = "json", value = "json", required = true) @RequestBody String json) throws Exception {
return bpmPluginsService.saveSubMappingStart(defId, nodeId, json);
}
/**
* 获取子流程发起设置插件json
*/
@RequestMapping(value = "getSubProcessPlugin", method = RequestMethod.GET, produces = {
"application/json; charset=utf-8" })
@ApiOperation(value = "获取子流程发起设置插件json", httpMethod = "GET", notes = "获取子流程发起设置插件json")
public String getSubProcessPlugin(
@ApiParam(name = "defId", value = "流程定义id", required = true) @RequestParam String defId,
@ApiParam(name = "nodeId", value = "节点id", required = true) @RequestParam String nodeId) throws Exception {
return bpmPluginsService.getSubMappingPlugin(defId, nodeId);
}
}