From 9fffc6fed34faa06130db3a88f6e81a2ddec6685 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Mon, 11 Sep 2017 15:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=A0=E5=8F=82=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FlowableUtilsController.java | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/FlowableUtilsController.java b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/FlowableUtilsController.java index f27154d0c..898318b53 100644 --- a/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/FlowableUtilsController.java +++ b/hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/FlowableUtilsController.java @@ -27,13 +27,14 @@ import static org.hswebframework.web.commons.entity.param.QueryParamEntity.singl public class FlowableUtilsController { @Autowired - BpmActivityService bpmActivityService; + BpmActivityService bpmActivityService; @Autowired ActDefService actDefService; /** * 获取流程所有配置节点 + * * @param procDefId * @return */ @@ -42,43 +43,30 @@ public class FlowableUtilsController { List> list = new ArrayList<>(); List activities = bpmActivityService.getActivitiesById(procDefId, null); for (ActivityImpl activity : activities) { - Map map = new HashMap<>(); - if(activity.getProperty("type").equals("startEvent")){ + Map map = new HashMap<>(); + if (activity.getProperty("type").equals("startEvent")) { map.put("id", activity.getId()); map.put("name", "流程发起者"); map.put("info", actDefService.selectSingle(single(ActDefEntity.actId, activity.getId()))); - }else if (activity.getProperty("type").equals("userTask")){ + } else if (activity.getProperty("type").equals("userTask")) { map.put("id", activity.getId()); map.put("name", activity.getProperty("name").toString()); map.put("info", actDefService.selectSingle(single(ActDefEntity.actId, activity.getId()))); } - if(map.size()>0) list.add(map); + if (map.size() > 0) list.add(map); } return ResponseMessage.ok(list); } /** * 给流程节点配置表单与人员矩阵 - * @param entity + * + * @param actDefEntity * @return */ - @PostMapping("act/{entity}") - public ResponseMessage setActClaimDef(@PathVariable String entity){ - try{ - List list = JSON.parseArray(entity,Map.class); - for(Map map : list){ - ActDefEntity actDefEntity = actDefService.selectSingle(single(ActDefEntity.actId,map.get("act_id").toString())); - if(actDefEntity==null) actDefEntity = actDefService.createEntity(); - actDefEntity.setActId(map.get("act_id").toString()); - actDefEntity.setFormId(map.get("form_id").toString()); - actDefEntity.setDefId(map.get("def_id").toString()); - actDefEntity.setType(map.get("type").toString()); - actDefService.saveOrUpdate(actDefEntity); - } - return ResponseMessage.ok("保存成功"); - }catch (Exception e){ - return ResponseMessage.ok("保存失败"); - } + @PostMapping("act") + public ResponseMessage setActClaimDef(@RequestBody ActDefEntity actDefEntity) { + return ResponseMessage.ok(actDefService.saveOrUpdate(actDefEntity)); } }