From cee95af175753b6b5876f0c8eee98682c5ceb910 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Wed, 7 May 2025 12:38:28 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96OA=E5=BE=85=E5=8A=9E?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit s --- .../workflow/todoZyTaskServiceHandler.java | 13 +++++++----- main/java/shjh/jhzj7/fi/fi/utils/OAUtils.java | 20 ++++++++++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/plugin/workflow/todoZyTaskServiceHandler.java b/main/java/shjh/jhzj7/fi/fi/plugin/workflow/todoZyTaskServiceHandler.java index aa8e184..2d729c6 100644 --- a/main/java/shjh/jhzj7/fi/fi/plugin/workflow/todoZyTaskServiceHandler.java +++ b/main/java/shjh/jhzj7/fi/fi/plugin/workflow/todoZyTaskServiceHandler.java @@ -94,16 +94,19 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { Map params = toDoInfo.getParams(); String subjectJson = (String) params.get("subject"); JSONObject subjectObj = JSONObject.parseObject(subjectJson); - String title = ""; + String title = "单据编号:" + billNo; if (null != subjectObj) { title = subjectObj.getString("zh_CN"); } - // 节点名称 String executionName = ""; - DynamicObject execution = BusinessDataServiceHelper.loadSingle(executionId, "wf_execution"); - if (execution != null) { - executionName = execution.getString("activityname");// 节点名称 + try { + DynamicObject execution = BusinessDataServiceHelper.loadSingle(executionId, "wf_execution"); + if (execution != null) { + executionName = execution.getString("activityname");// 节点名称 + } + } catch (Exception e) { + logger.error("获取节点名称失败", e); } // 获取Url String url = toDoInfo.getUrl(); // 链接 diff --git a/main/java/shjh/jhzj7/fi/fi/utils/OAUtils.java b/main/java/shjh/jhzj7/fi/fi/utils/OAUtils.java index 8bb5189..e5e6b23 100644 --- a/main/java/shjh/jhzj7/fi/fi/utils/OAUtils.java +++ b/main/java/shjh/jhzj7/fi/fi/utils/OAUtils.java @@ -20,7 +20,7 @@ public class OAUtils { public static final String oaUrl = System.getProperty("oaUrl");//测试环境 public static final String oaAPIKey = System.getProperty("oaAPIKey");//测试环境APIKey private static final Log logger = LogFactory.getLog(OAUtils.class); - private static final String Apimenthod = "OA待办接口"; + private static final String Apimenthod = "OA接口"; // public static final String oaUrl = "https://hipint.jahwa.com.cn:6443/gateway/HIP_ReceiveToOA/1.0/receiveToOA";//正式环境 // public static final String oaAPIKey = "8281da80-b39b-48c4-83bd-f8e480740c6a";//测试环境APIKey @@ -94,6 +94,16 @@ public class OAUtils { * @param thirdPartyMap 第三方数据映射 */ private static void processRequest(Map customerHeader, JSONObject pendingsBody, Map thirdPartyMap) { + //0:待办,2:已办,4:办结 + String o = ""+thirdPartyMap.get("isremark"); + String title = "未知:"; + if ("0".equals(o)) { + title = "待办:"; + }else if ("2".equals(o)) { + title = "已办:"; + }else if ("4".equals(o)) { + title = "办结:"; + } String pendingPostjson = null; JSONObject jsonObject = null; try { @@ -103,10 +113,10 @@ public class OAUtils { // 检查JSON对象是否为空 if (jsonObject != null && !jsonObject.isEmpty()) { - handleResponse(jsonObject, pendingsBody, thirdPartyMap); + handleResponse(jsonObject, pendingsBody, thirdPartyMap,title); }else { logger.info("推送OA消息失败!"); - saveLog("待办:" +(thirdPartyMap.get("billno").toString()), pendingsBody, jsonObject, false); + saveLog(title +(thirdPartyMap.get("billno").toString()), pendingsBody, jsonObject, false); } } catch (Exception e) { handleException(e, pendingsBody, thirdPartyMap, jsonObject); @@ -133,7 +143,7 @@ public class OAUtils { * @param pendingsBody 请求体 * @param thirdPartyMap 第三方数据映射 */ - private static void handleResponse(JSONObject jsonObject, JSONObject pendingsBody, Map thirdPartyMap) { + private static void handleResponse(JSONObject jsonObject, JSONObject pendingsBody, Map thirdPartyMap,String title) { String code = (String) jsonObject.get("code"); boolean isSuccess = false; String logMessage = ""; @@ -152,7 +162,7 @@ public class OAUtils { } logger.info(logMessage); - saveLog("待办:" + thirdPartyMap.get("billno").toString(), pendingsBody, jsonObject, isSuccess); + saveLog(title + thirdPartyMap.get("billno").toString(), pendingsBody, jsonObject, isSuccess); }