NodeController.java
24.9 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
package com.hotent.bpmModel.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.hotent.base.exception.BaseException;
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 org.springframework.web.servlet.ModelAndView;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.hotent.base.annotation.ApiGroup;
import com.hotent.base.annotation.NewVersion;
import com.hotent.base.constants.ApiGroupConsts;
import com.hotent.base.feign.FormFeignService;
import com.hotent.base.model.CommonResult;
import com.hotent.base.query.PageList;
import com.hotent.base.util.AppUtil;
import com.hotent.base.util.BeanUtils;
import com.hotent.base.util.JsonUtil;
import com.hotent.base.util.StringUtil;
import com.hotent.bpm.api.constant.ScriptType;
import com.hotent.bpm.api.helper.identity.UserQueryPluginHelper;
import com.hotent.bpm.api.model.process.def.BpmProcessDef;
import com.hotent.bpm.api.model.process.def.BpmProcessDefExt;
import com.hotent.bpm.api.model.process.def.BpmSubTableRight;
import com.hotent.bpm.api.model.process.def.BpmVariableDef;
import com.hotent.bpm.api.model.process.nodedef.BpmNodeDef;
import com.hotent.bpm.api.model.process.nodedef.ext.AutoTaskDef;
import com.hotent.bpm.api.model.process.nodedef.ext.SignNodeDef;
import com.hotent.bpm.api.model.process.nodedef.ext.UserTaskNodeDef;
import com.hotent.bpm.api.model.process.nodedef.ext.extmodel.DefaultJumpRule;
import com.hotent.bpm.api.model.process.nodedef.ext.extmodel.PrivilegeItem;
import com.hotent.bpm.api.model.process.nodedef.ext.extmodel.SignRule;
import com.hotent.bpm.api.plugin.core.context.BpmPluginContext;
import com.hotent.bpm.api.service.BpmDefinitionAccessor;
import com.hotent.bpm.api.service.BpmDefinitionService;
import com.hotent.bpm.engine.def.impl.handler.ServiceNodeBpmDefXmlHandler;
import com.hotent.bpm.persistence.model.DefaultBpmProcessDefExt;
import com.hotent.bpm.plugin.core.util.UserAssignRuleParser;
import com.hotent.bpmModel.manager.BpmNodeService;
import com.hotent.bpmModel.params.DefConfSaveVo;
import com.hotent.bpmModel.params.NodeConfCopyVo;
import com.hotent.bpmModel.params.NodeConfSaveVo;
import com.hotent.bpmModel.params.VarTreeGetVo;
import com.hotent.uc.api.model.IUser;
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/node/v1/")
@Api(tags="流程节点设置")
@ApiGroup(group= {ApiGroupConsts.GROUP_BPM})
@NewVersion
public class NodeController {
@Resource
BpmDefinitionService bpmDefinitionService;
@Resource
BpmDefinitionAccessor bpmDefinitionAccessor;
@Resource
private UserQueryPluginHelper userQueryPluginHelper;
@Autowired
FormFeignService formFeignService;
@Autowired
private BpmNodeService nodeService;
@RequestMapping(value="saveSub", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "保存表单权限配置", httpMethod = "POST", notes = "获取表单权限")
public CommonResult<String> saveSub(@ApiParam(name="nodeId",value="节点ID")@RequestParam String nodeId,
@ApiParam(name="defId",value="权限类型 ")@RequestParam String defId,
@ApiParam(name="parentDefKey",value="父流程定义")@RequestParam String parentDefKey,HttpServletRequest request) throws Exception {
CommonResult<String> res=nodeService.saveSub(nodeId,defId,parentDefKey,request);
return res;
}
@RequestMapping(value="initSub", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "显示表单权限配置", httpMethod = "GET", notes = "显示表单权限配置")
public Object initSub(@ApiParam(name="nodeId",value="节点ID")@RequestParam String nodeId,
@ApiParam(name="defId",value="权限类型 ")@RequestParam String defId,
@ApiParam(name="parentDefKey",value="父流程定义")@RequestParam String parentDefKey) throws Exception {
Map<String,JsonNode> map = new HashMap<>();
BpmNodeDef nodeDef = bpmDefinitionAccessor.getBpmNodeDef(defId, nodeId);
UserTaskNodeDef utnd = (UserTaskNodeDef) nodeDef;
for (BpmSubTableRight bsr : utnd.getBpmSubTableRightByParentDefKey(parentDefKey)) {
map.put(bsr.getTableName(),JsonUtil.toJsonNode(bsr));
}
return map;
}
/**
* 编辑节点规则页面初始化数据
*/
@RequestMapping(value="ruleEdit", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "编辑节点规则页面初始化数据", httpMethod = "GET", notes = "编辑节点规则页面初始化数据")
public Map<String,Object> ruleEdit(
@ApiParam(name="definitionId",value="流程定义id")@RequestParam String definitionId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId) throws Exception {
Map<String,Object> res=nodeService.ruleEdit(definitionId,nodeId);
return res;
}
/**
* 节点规则列表
*/
@SuppressWarnings("unchecked")
@RequestMapping(value="ruleListJson", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "节点规则列表", httpMethod = "POST", notes = "节点规则列表")
public PageList<DefaultJumpRule> ruleListJson(
@ApiParam(name="definitionId",value="流程定义id")@RequestParam String definitionId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId) throws Exception {
UserTaskNodeDef nodeDef = (UserTaskNodeDef) bpmDefinitionService.getBpmNodeDefByDefIdNodeId(definitionId, nodeId);
List<DefaultJumpRule> rules = nodeDef.getJumpRuleList();
if(rules == null)rules = Collections.EMPTY_LIST;
return new PageList<DefaultJumpRule>(rules);
}
/**
* 判断当前节点是否是子流程中的节点,并且还不能是第一个节点
*/
@RequestMapping(value="isSubFirstNode", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "是否是子流程中非第一节点", httpMethod = "GET", notes = "节点规则列表")
public CommonResult<Boolean> isSubFirstNode(
@ApiParam(name="definitionId",value="流程定义id")@RequestParam String definitionId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId,
@ApiParam(name="parentKey",value="父流程Key")@RequestParam String parentKey) throws Exception {
return nodeService.isSubFirstNode(definitionId,nodeId,parentKey);
}
/**
* 保存节点的跳转规则
*/
@SuppressWarnings("unchecked")
@RequestMapping(value="ruleSave",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "保存节点的跳转规则", httpMethod = "POST", notes = "保存节点的跳转规则")
public CommonResult<String> ruleSave(
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId,
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeList",value="节点规则json", required = true) @RequestBody List<JsonNode> nodeList) throws Exception {
CommonResult<String> res=nodeService.ruleSave(nodeId,defId,nodeList);
return res;
}
/**
* 保存节点json 配置
*
* @param request
* @param response
* @throws Exception
*/
@RequestMapping(value="nodeUserConditionSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "保存节点json 配置", httpMethod = "POST", notes = "保存节点json 配置")
public CommonResult<String> nodeUserConditionSave(@ApiParam(name="vo",value="节点保存对象")@RequestBody NodeConfSaveVo vo) throws Exception {
CommonResult<String> res=nodeService.nodeUserConditionSave(vo);
return res;
}
/**
* 节点规则脚本设置
*/
@RequestMapping(value="eventScriptEdit", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "节点规则脚本设置", httpMethod = "GET", notes = "节点规则脚本设置")
public Map<String, Object> eventScriptEdit(
@ApiParam(name="defId",value="流程定义id")@RequestParam String defId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId) throws Exception {
BpmNodeDef bpmNodeDef = bpmDefinitionAccessor.getBpmNodeDef(defId, nodeId);
Map<ScriptType, String> scriptMap = bpmNodeDef.getScripts();
Map<String, Object> resMap=new HashMap<>();
resMap.put("bpmNodeDef", bpmNodeDef);
resMap.put("eventScriptMap", scriptMap);
return resMap;
}
/**
* 节点事件脚本保存
*/
@RequestMapping(value="eventScriptSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "节点事件脚本保存", httpMethod = "POST", notes = "节点事件脚本保存")
public CommonResult<String> eventScriptSave(@ApiParam(name="vo",value="节点配置保存对象")@RequestBody NodeConfSaveVo vo) throws Exception {
CommonResult<String> res=nodeService.eventScriptSave(vo);
return res;
}
/**
* 获取分支设置信息
*/
@RequestMapping(value="branchConditionEdit", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "获取分支设置信息", httpMethod = "GET", notes = "获取分支设置信息")
public Map<String,Object> branchConditionEdit(
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId,
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId) throws Exception {
Map<String,Object> res=nodeService.branchConditionEdit(nodeId,defId);
return res;
}
/**
* 分支节点规则脚本保存
*/
@RequestMapping(value="branchConditionSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "分支节点规则脚本保存", httpMethod = "POST", notes = "分支节点规则脚本保存")
public CommonResult<String> branchConditionSave(@ApiParam(name="vo",value="节点配置保存对象")@RequestBody NodeConfSaveVo vo) throws Exception {
CommonResult<String> res=nodeService.branchConditionSave(vo);
return res;
}
/**
* 自动任务管理
*/
@RequestMapping(value="autoTaskManager", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "自动任务管理", httpMethod = "GET", notes = "自动任务管理")
public Map<String,Object> autoTaskManager(
@ApiParam(name="defId",value="流程定义id")@RequestParam String defId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId) throws Exception {
Map<String,Object> data= new HashMap<>();
AutoTaskDef autoTaskDef = (AutoTaskDef) bpmDefinitionAccessor.getBpmNodeDef(defId, nodeId);
BpmPluginContext bpmPluginContext = autoTaskDef.getAutoTaskBpmPluginContext();
data.put("bpmPluginContext", bpmPluginContext);
return data;
}
/**
* 自动节点,获取插件数据
*/
@RequestMapping("autoTaskPluginGet")
public Map<String,Object> autoTaskPluginGet(
@ApiParam(name="defId",value="流程定义id")@RequestParam String defId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId,
@ApiParam(name="pluginType",value="插件类型")@RequestParam String pluginType) throws Exception {
Map<String,Object> res=nodeService.autoTaskPluginGet(defId,nodeId,pluginType);
return res;
}
/**
* 自动节点保存json 配置
*
* @param request
* @param response
* @throws Exception
*/
@RequestMapping(value="autoTaskPluginSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "自动节点保存json 配置", httpMethod = "POST", notes = "自动节点保存json 配置")
public CommonResult<String> autoTaskPluginSave(@ApiParam(name="vo",value="节点配置保存对象")@RequestBody NodeConfSaveVo vo) throws Exception {
String defId = vo.getDefId();
String nodeId = vo.getNodeId();
String jsonStr = vo.getJsonStr();
try {
if (StringUtil.isNotEmpty(nodeId)) {
ServiceNodeBpmDefXmlHandler serviceNodeDefXmlHandler = AppUtil.getBean(ServiceNodeBpmDefXmlHandler.class);
serviceNodeDefXmlHandler.saveNodeXml(defId, nodeId, jsonStr);
}
return new CommonResult<String>("更新节点配置成功");
} catch (Exception e) {
e.printStackTrace();
return new CommonResult<String>(false,"更新节点配置失败:"+e.getMessage());
}
}
/**
* 获取会签规则特权配置
*/
@RequestMapping(value="getSignConfig", method=RequestMethod.GET, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "获取会签规则特权配置", httpMethod = "GET", notes = "获取会签规则特权配置")
public Object getSignConfig(
@ApiParam(name="defId",value="流程定义id")@RequestParam String defId,
@ApiParam(name="nodeId",value="节点id")@RequestParam String nodeId) throws Exception {
SignNodeDef signNodeDef = (SignNodeDef) bpmDefinitionAccessor.getBpmNodeDef(defId, nodeId);
List<PrivilegeItem> privilegeList = signNodeDef.getPrivilegeList();
SignRule signRule = signNodeDef.getSignRule();
Map<String,Object> map = new HashMap<String,Object>();
map.put("privilegeList", getPrivilegeListJson(privilegeList));
map.put("signRule", SignRule.toJson(signRule));
return map;
}
/** 将PrivilegeList 转化成json
* @throws IOException */
@SuppressWarnings({ })
private ObjectNode getPrivilegeListJson(List<PrivilegeItem> privilegeList) throws IOException {
ObjectNode ObjectNode = JsonUtil.getMapper().createObjectNode();
if (BeanUtils.isEmpty(privilegeList)) return ObjectNode;
for (PrivilegeItem privilege : privilegeList) {
ArrayNode config=JsonUtil.getMapper().createArrayNode();
UserAssignRuleParser.handJsonConfig(config, privilege.getUserRuleList());
ObjectNode.set(privilege.getPrivilegeMode().getKey(), config);
}
String json = ObjectNode.toString().replaceAll("null,", "\"\",");
return (ObjectNode) JsonUtil.toJsonNode(json);
}
/**
* 会签规则特权配置
*/
@RequestMapping(value="signConfigSave", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "会签规则特权配置", httpMethod = "POST", notes = "获取会签规则特权配置")
public Object signConfigSave(@ApiParam(name="vo",value="节点配置保存对象")@RequestBody NodeConfSaveVo vo) throws Exception {
Object res=nodeService.signConfigSave(vo);
return res;
}
/**
* 预览人员条件
*
* @param request
* @param response
* @throws Exception
*/
@SuppressWarnings("unchecked")
@RequestMapping(value="previewCondition",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "预览人员条件", httpMethod = "GET", notes = "添加bo定义")
public PageList<IUser> previewCondition(
@ApiParam(name="conditionArray",value="人员条件数组", required = true)@RequestParam String conditionArray,
@ApiParam(name="variables",value="变量", required = true)@RequestParam String variables) throws Exception {
ObjectNode obj = (ObjectNode) JsonUtil.toJsonNode(variables);
Map<String, String> map = (Map<String, String>) obj;
List<IUser> users = userQueryPluginHelper.queryUsersByConditions(conditionArray, map);
return (PageList<IUser>) users;
}
/**
* 获取流程节点的流程变量 bo变量,流程变量
*/
/*@RequestMapping("flowVarDialog")
public ModelAndView flowVarDialog(HttpServletRequest request, HttpServletResponse response) throws Exception {
String defId = RequestUtil.getString(request, "defId");
String nodeId = RequestUtil.getString(request, "nodeId");
List<GroupType> dimensionList = userGroupService.getGroupTypes();
return getAutoView().addObject("defId", defId).addObject("nodeId", nodeId).addObject("dimensionList", dimensionList);
}*/
/**
* 该节点能用的所有变量
* @throws Exception
*/
private List<BpmVariableDef> getAllBpmVariableDef(String defId, String nodeId) throws Exception {
List<BpmVariableDef> bpmVariableList = new ArrayList<BpmVariableDef>();
// 全局变量
BpmProcessDef<BpmProcessDefExt> bpmProcessDefExt = bpmDefinitionAccessor.getBpmProcessDef(defId);
DefaultBpmProcessDefExt defExt = (DefaultBpmProcessDefExt) bpmProcessDefExt.getProcessDefExt();
if (defExt.getVariableList() != null) {
bpmVariableList.addAll(defExt.getVariableList());
}
List<BpmNodeDef> list = bpmProcessDefExt.getBpmnNodeDefs();
for (BpmNodeDef node : list) {
if (!node.getNodeId().equals(nodeId))
continue;
if (!node.getType().toString().equalsIgnoreCase("usertask"))
continue;
UserTaskNodeDef targetNodeDef = (UserTaskNodeDef) node;
if (targetNodeDef.getVariableList() != null) {
bpmVariableList.addAll(targetNodeDef.getVariableList());
}
}
return bpmVariableList;
}
/**
* 规则选择框
*/
@RequestMapping("userAssignConditionDialog")
public ModelAndView userAssignConditionDialog(HttpServletRequest request, HttpServletResponse response, String defId, String nodeId) throws Exception {
return new ModelAndView("/flow/def/userAssignConditionDialog.jsp").addObject("defId", defId).addObject("nodeId", nodeId);
}
/**
* 验证handler。 输入格式为 serviceId +"." + 方法名。
*
* @param request
* @param response
* @throws IOException
*/
@RequestMapping(value="validHandler",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "验证handler。 输入格式为 serviceId +.法名", httpMethod = "GET", notes = "验证handler。 输入格式为 serviceId +.法名")
public Object validHandler(@ApiParam(name="handler",value="handler字符串", required = true) @RequestParam String handler) throws IOException {
Object res=nodeService.validHandler(handler);
return res;
}
/**
* 流程变量对话框的树 其中包含:bodef的字段,流程变量,流程常量(发起人,当前用户,...)
*
* @param request
* @param response
* @return
* @throws Exception
* Object
* @exception
* @since 1.0.0
*/
@RequestMapping(value="varTree",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "流程变量对话框的树 其中包含:bodef的字段,流程变量,流程常量(发起人,当前用户,...)", httpMethod = "POST", notes = "流程变量对话框的树 其中包含:bodef的字段,流程变量,流程常量(发起人,当前用户,...)")
public Object varTree(@ApiParam(name="vo",value="获取流程变量参数", required = true) @RequestBody VarTreeGetVo vo)throws Exception {
Object res=nodeService.varTree(vo);
return res;
}
/**
* 获取流程节点的列表 一些基本信息而已
*
* @param request
* @param response
* @return
* @throws Exception
* Object
* @exception
* @since 1.0.0
*/
@RequestMapping(value="getNodes",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "获取流程节点的列表 一些基本信息而已", httpMethod = "GET", notes = "获取流程节点的列表 一些基本信息而已")
public Object getNodes(@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId) throws Exception {
Object res=nodeService.getNodes(defId);
return res;
}
/**
* 流程定义节点配置页面json数据
* @return json
* @throws Exception
*/
@RequestMapping(value="getDefSetting",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "流程定义节点配置页面json数据", httpMethod = "GET", notes = "流程定义节点配置页面json数据")
public Map<String, Object> nodeDefSetting(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="topDefKey",value="父流程定义key", required = true) @RequestParam String topDefKey) throws Exception {
Map<String, Object> res=nodeService.nodeDefSetting(defId,topDefKey);
return res;
}
/**流程定义节点配置页面json数据
* @return json
* @throws IOException
* @throws Exception
*//*
@RequestMapping(value="getDefSetting",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "流程定义设置json数据", httpMethod = "GET", notes = "流程定义设置json数据")
public Map<String, Object> getDefSetting(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="topDefKey",value="父流程定义key", required = true) @RequestParam String topDefKey) throws Exception {
return returnData;
}*/
/**
* 保存流程配置
*
* @param request
* @param reponse
* @throws Exception
*/
@SuppressWarnings({ })
@RequestMapping(value="saveDefConf", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "保存流程配置", httpMethod = "POST", notes = "保存流程配置")
public CommonResult<String> saveDefConf(@ApiParam(name="vo",value="流程设置保存对象")@RequestBody DefConfSaveVo vo) throws Exception {
CommonResult<String> res=nodeService.saveDefConf(vo);
return res;
}
/**
* 取得当前节点的所有出口节点集合
* @param defId
* @param nodeId
* @return
* @throws Exception
*/
@RequestMapping(value="getNodeOutcomes",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "取得当前节点的所有出口节点集合", httpMethod = "GET", notes = "取得当前节点的所有出口节点集合")
public Map<String,Object> getNodeOutcomes(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId) throws Exception{
Map<String,Object> res=nodeService.getNodeOutcomes(defId,nodeId);
return res;
}
/**
* 自动任务信息明细
*/
@RequestMapping(value="getNodeAutoTask",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "自动任务信息明细", httpMethod = "GET", notes = "自动任务信息明细")
public Object getNodeAutoTask(
@ApiParam(name="defId",value="流程定义id", required = true) @RequestParam String defId,
@ApiParam(name="nodeId",value="节点id", required = true) @RequestParam String nodeId) throws Exception {
Object res=nodeService.getNodeAutoTask(defId,nodeId);
return res;
}
/**
* 根据流程定义ID获取全局表单
* */
@RequestMapping(value="getGlobalForm",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "根据流程定义ID获取全局表单", httpMethod = "GET", notes = "根据流程定义ID获取全局表单")
public ObjectNode getGlobalForm(@ApiParam(name = "defId",value = "流程定义ID")@RequestParam String defId,
@ApiParam(name = "type", value = "表单类型(PC或者mobile)")@RequestParam String type)throws Exception{
try{
return nodeService.getGlobalForm(defId,type);
}catch (BaseException e){
e.setMessage("url表单配置除外");//修改提示
throw e;
}
}
/**
* 节点配置复制
*
* @param request
* @param reponse
* @throws Exception
*/
@RequestMapping(value="copyNodeConf", method=RequestMethod.POST, produces={"application/json; charset=utf-8" })
@ApiOperation(value = "节点配置复制", httpMethod = "POST", notes = "节点配置复制")
public CommonResult<String> copyNodeConf(@ApiParam(name="vo",value="节点复制对象")@RequestBody NodeConfCopyVo vo) throws Exception {
CommonResult<String> res=nodeService.copyNodeConf(vo);
return res;
}
@RequestMapping(value="getDefSettingByDefKey",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" })
@ApiOperation(value = "根据流程定义Key获取流程定义节点配置页面json数据", httpMethod = "GET", notes = "根据流程定义Key获取流程定义节点配置页面json数据")
public Map<String, Object> getDefSettingByDefKey(
@ApiParam(name="defKey",value="流程定义key", required = true) @RequestParam String defKey,
@ApiParam(name="topDefKey",value="父流程定义key", required = true) @RequestParam String topDefKey) throws Exception {
Map<String, Object> res=nodeService.getDefSettingByDefKey(defKey,topDefKey);
return res;
}
}