feat(REQ-5369) - 调整获取打印字段变量的接口
This commit is contained in:
parent
d4f6568de0
commit
14f57091d9
@ -72,5 +72,6 @@ public interface PrintAdminApi {
|
||||
@GetMapping("/api/print/admin/field/variables")
|
||||
@Manageable
|
||||
@InvokeMode(SYNC)
|
||||
CommonResponse<Map<String, Object>> getPrintFieldVariables(@NotBlank(message = "流程实例不能为空") @RequestParam String processInstanceId);
|
||||
CommonResponse<Map<String, Object>> getPrintFieldVariables(@NotBlank(message = "流程实例不能为空") @RequestParam String processInstanceId,
|
||||
@RequestParam(required = false, defaultValue = "true") Boolean throwException);
|
||||
}
|
||||
|
||||
@ -322,10 +322,11 @@ public class PrintAdminController implements PrintAdminApi {
|
||||
@Operation(summary = "获取指定流程下用于替换打印的相关变量")
|
||||
@GetMapping("/field/variables")
|
||||
@Override
|
||||
public CommonResponse<Map<String, Object>> getPrintFieldVariables(@NotBlank(message = "流程实例不能为空") @RequestParam String processInstanceId) {
|
||||
public CommonResponse<Map<String, Object>> getPrintFieldVariables(@NotBlank(message = "流程实例不能为空") @RequestParam String processInstanceId,
|
||||
@RequestParam(required = false, defaultValue = "true") Boolean throwException) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
|
||||
byte[] formInstanceValue = commandExecutor.execute(new CustomGetFormInstanceLatestValuesCmd(processInstanceId));
|
||||
byte[] formInstanceValue = commandExecutor.execute(new CustomGetFormInstanceLatestValuesCmd(processInstanceId, throwException));
|
||||
if (!ObjectUtils.isEmpty(formInstanceValue)) {
|
||||
JSONObject treeNode = JSON.parseObject(new String(formInstanceValue));
|
||||
result.putAll(treeNode.getJSONObject("values").getInnerMap());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user