From 4ba503fbdcba28ba7fa26ed8b219a20658a44060 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期二, 14 一月 2025 13:40:36 +0800 Subject: [PATCH] 监听器注入字段换成中文 --- business/src/main/java/com/ycl/listener/flowable/FlowableOverTimeListener.java | 18 +++++++++--------- flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java | 12 +++++++----- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/business/src/main/java/com/ycl/listener/flowable/FlowableOverTimeListener.java b/business/src/main/java/com/ycl/listener/flowable/FlowableOverTimeListener.java index 70eac33..4be1147 100644 --- a/business/src/main/java/com/ycl/listener/flowable/FlowableOverTimeListener.java +++ b/business/src/main/java/com/ycl/listener/flowable/FlowableOverTimeListener.java @@ -35,15 +35,15 @@ /** * 榛勭爜鏃堕棿 */ - private FixedValue yellowTime; + private FixedValue 榛勭爜鏃堕暱; /** * 绾㈢爜鏃堕棿 */ - private FixedValue redTime; + private FixedValue 绾㈢爜鏃堕暱; /** * 璁℃椂璧峰鑺傜偣瀹氫箟Id */ - private FixedValue startTaskId; + private FixedValue 寮�濮嬭鏃惰妭鐐�; @Override public void notify(DelegateTask delegateTask) { @@ -69,15 +69,15 @@ }else { processCoding.setStatus(GREEN); } - if (yellowTime != null && yellowTime.getValue(delegateTask) != null) { - processCoding.setYellowTime(Integer.parseInt(yellowTime.getValue(delegateTask).toString())); + if (榛勭爜鏃堕暱 != null && 榛勭爜鏃堕暱.getValue(delegateTask) != null) { + processCoding.setYellowTime(Integer.parseInt(榛勭爜鏃堕暱.getValue(delegateTask).toString())); } - if (redTime != null && redTime.getValue(delegateTask) != null) { - processCoding.setRedTime(Integer.parseInt(redTime.getValue(delegateTask).toString())); + if (绾㈢爜鏃堕暱 != null && 绾㈢爜鏃堕暱.getValue(delegateTask) != null) { + processCoding.setRedTime(Integer.parseInt(绾㈢爜鏃堕暱.getValue(delegateTask).toString())); } //璁剧疆寮�濮嬭妭鐐� - if (startTaskId != null && startTaskId.getValue(delegateTask) != null) { - String taskDefKey = startTaskId.getValue(delegateTask).toString(); + if (寮�濮嬭鏃惰妭鐐� != null && 寮�濮嬭鏃惰妭鐐�.getValue(delegateTask) != null) { + String taskDefKey = 寮�濮嬭鏃惰妭鐐�.getValue(delegateTask).toString(); //寮�濮嬭妭鐐逛粠鍘嗗彶鑺傜偣鏌ヨ 鍙栧鏉′腑鏈�鏃╃殑涓�鏉� List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery() .processInstanceId(processInstanceId) diff --git a/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java b/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java index 6cf3937..82f8e1b 100644 --- a/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java +++ b/flowable/src/main/java/com/ycl/service/impl/FlowTaskServiceImpl.java @@ -144,12 +144,12 @@ newV.put(task.getTaskDefinitionKey() + "&" + key, variables.get(key)); //瀛楀吀閲屾湁灏辨斁鍏ユ祦绋嬪彉閲忎腑 if (!CollectionUtils.isEmpty(dictList) && dictList.contains(key)) { - processVariables.put(key,variables.get(key)); + processVariables.put(key, variables.get(key)); } } } //娣诲姞娴佺▼鍙橀噺 - if(!processVariables.isEmpty()) taskService.setVariables(taskId,processVariables); + if (!processVariables.isEmpty()) taskService.setVariables(taskId, processVariables); taskService.addComment(taskId, task.getProcessInstanceId(), FlowComment.SUBMIT.getType(), "瀹屾垚鎻愪氦"); // 鍒ゆ柇褰撳墠浠诲姟鏄笉鏄浆鍔炶繃鐨� Boolean delegation = flowLogService.taskDelegation(task.getProcessInstanceId(), task.getId()); @@ -1302,9 +1302,11 @@ }); // 璁剧疆宸插~鍐欑殑琛ㄥ崟涓虹鐢ㄧ姸鎬� - for (JSONObject oldField : oldFields) { - JSONObject options = oldField.getJSONObject("options"); - options.put("disabled", true); + if (!CollectionUtils.isEmpty(oldFields)) { + for (JSONObject oldField : oldFields) { + JSONObject options = oldField.getJSONObject("options"); + options.put("disabled", true); + } } // TODO 鏆傛椂鍙鐞嗙敤鎴蜂换鍔′笂鐨勮〃鍗� // if (StringUtils.isNotBlank(task.getFormKey())) { -- Gitblit v1.8.0