Appearance
修改流程发送时收件人员
应用场景
在流程传递至下一环节时,接收人员会面临一些条件限制,这些条件下需要对接收人员的数据进行必要的处理,比如过滤掉不符合要求的人员信息,人员昵称的特殊显示等。
扩展接口实现
java
package com.kqgeo.co.ext.controller;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.kqgeo.co.ext.config.Description;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("ext/co/flow")
public class FlowDemo {
/**
* 修改流程发送时收件人员
* @param parameter
* @return
*/
@RequestMapping(value = "/send/destroy/receive", method = RequestMethod.POST)
@Description(describe = "流程发送查询接收人后置处理", instructions = "FlowSend:DESTROY", requestType = "post", requestUrl = "/ext/co/flow/send/destroy/receive")
public JsonNode flowSendDestroyReceiver(@RequestBody ObjectNode parameter) {
JsonNode argsJson = parameter.get("args");
//获取接收人信息
JsonNode jsonNode = argsJson.get(5).get("PARAMETER");
//将 "测试人" 名称更改为 "张晓明"
String result = jsonNode.toString().replace("测试人", "张晓明");
ObjectMapper objectMapper = new ObjectMapper();
JsonNode resultNode = objectMapper.readTree(result);
return resultNode;
}
}
package com.kqgeo.co.ext.controller;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.kqgeo.co.ext.config.Description;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("ext/co/flow")
public class FlowDemo {
/**
* 修改流程发送时收件人员
* @param parameter
* @return
*/
@RequestMapping(value = "/send/destroy/receive", method = RequestMethod.POST)
@Description(describe = "流程发送查询接收人后置处理", instructions = "FlowSend:DESTROY", requestType = "post", requestUrl = "/ext/co/flow/send/destroy/receive")
public JsonNode flowSendDestroyReceiver(@RequestBody ObjectNode parameter) {
JsonNode argsJson = parameter.get("args");
//获取接收人信息
JsonNode jsonNode = argsJson.get(5).get("PARAMETER");
//将 "测试人" 名称更改为 "张晓明"
String result = jsonNode.toString().replace("测试人", "张晓明");
ObjectMapper objectMapper = new ObjectMapper();
JsonNode resultNode = objectMapper.readTree(result);
return resultNode;
}
}
效果展示
二开前效果:
二开后效果: