diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/LarkOperateAbstract.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/LarkOperateAbstract.java index 7b1cfe6..0899b5b 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/LarkOperateAbstract.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/LarkOperateAbstract.java @@ -32,6 +32,7 @@ public abstract class LarkOperateAbstract{ }else { request.setErrorMessage(message); } + }finally { //业务处理完成后的系列操作,例如日志 endHandle(request); diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/operate/ApprovalCallbackOperate.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/operate/ApprovalCallbackOperate.java index d7e4bda..7730ed3 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/operate/ApprovalCallbackOperate.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/operate/ApprovalCallbackOperate.java @@ -109,6 +109,10 @@ public class ApprovalCallbackOperate extends LarkAbstract { request.setAppSecret(relation.getSecret()); LarkApprovalRequest detailRequest = new LarkApprovalRequest(request.getAppId(), request.getAppSecret(), event.getRecordId()); GetInstanceRespBody approvalInfoDetail = larkApprovalHelper.getApprovalInfoDetail(detailRequest); + JSONArray objects = JSONArray.parseArray(approvalInfoDetail.getForm()); + if (objects.size() == 1){ + return; + } request.setInstanceRespBody(approvalInfoDetail); String approvalName = approvalInfoDetail.getApprovalName(); request.setApproveName(approvalName); @@ -119,7 +123,9 @@ public class ApprovalCallbackOperate extends LarkAbstract { @Override protected void businessProcessing(RequestVo request) { - + if (request.getInstanceRespBody() == null){ + return; + } for (Map.Entry entry : request.getTableRelationMap().entrySet()) { String[] arr = entry.getKey().split("_"); request.setToAppToken(arr[0]); @@ -173,10 +179,10 @@ public class ApprovalCallbackOperate extends LarkAbstract { list.add(String.valueOf(object)); } else { List keyList = new ArrayList<>(); - for (int j = index+1; j < split.length; j++) { + for (int j = index + 1; j < split.length; j++) { keyList.add(split[j]); } - Object o = recursiveValue(jsonArray.getJSONObject(i), String.join(",",keyList)); + Object o = recursiveValue(jsonArray.getJSONObject(i), String.join(",", keyList)); list.add(String.valueOf(o)); } } @@ -207,9 +213,7 @@ public class ApprovalCallbackOperate extends LarkAbstract { eventLog = new EventLog(event.getId(), request.getApproveName(), request.getMessage()); } else { eventService.updateStatus(event.getId(), EventOperateStatus.PENDING.getCode(), event.getNumbers() + 1); - if (request.getEventOperateType() != null) { - new EventLog(event.getId(), request.getApproveName(), request.getMessage(), request.getErrorCode(), request.getErrorMessage()); - } + eventLog = new EventLog(event.getId(), request.getApproveName(), request.getMessage(), request.getErrorCode(), request.getErrorMessage()); } if (eventLog != null) { eventLog.setOperateInfo(request.getOperateInfo());