From 699295ce3e0e1116d1fc20f0fae89b66613bbacf Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期四, 28 八月 2025 17:40:51 +0800 Subject: [PATCH] 企业微信消息推送增加try catch 只记录错误日志,不抛出异常 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamRepairOrderServiceImpl.java | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamRepairOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamRepairOrderServiceImpl.java index e0ee841..81ed54b 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamRepairOrderServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamRepairOrderServiceImpl.java @@ -221,7 +221,11 @@ //鏇存柊璁惧缁翠慨鐘舵�� eamEquipmentExtendService.updateEquipmentRepairStatus(eamReportRepair.getEquipmentId(), EquipmentRepairStatus.UNDER_REPAIR.name()); //鎺ㄩ�佷紒涓氬井淇℃秷鎭� - sendQywxTemplateCardMessage(eamRepairOrder, eamReportRepair, null); + try { + sendQywxTemplateCardMessage(eamRepairOrder, eamReportRepair, null); + } catch (Exception e) { + log.error("鎺ㄩ�佷紒涓氬井淇℃秷鎭け璐ワ細" + e.getMessage(), e); + } } } @@ -236,6 +240,7 @@ String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.REPAIR_ORDER_CODE_RULE); eamRepairOrder.setRepairCode(codeSeq); EamReportRepair eamReportRepair = eamReportRepairService.getById(eamReportRepairQuery.getId()); + eamRepairOrder.setReportId(eamReportRepairQuery.getId()); eamRepairOrder.setDelFlag(CommonConstant.DEL_FLAG_0); eamRepairOrder.setEquipmentId(eamReportRepair.getEquipmentId()); eamRepairOrder.setRepairStatus(ReportRepairEnum.UNDER_REPAIR.name()); @@ -267,7 +272,11 @@ //鏇存柊璁惧缁翠慨鐘舵�� eamEquipmentExtendService.updateEquipmentRepairStatus(eamReportRepair.getEquipmentId(), EquipmentRepairStatus.UNDER_REPAIR.name()); //鎺ㄩ�佷紒涓氬井淇℃秷鎭� - sendQywxTemplateCardMessage(eamRepairOrder, null, null); + try { + sendQywxTemplateCardMessage(eamRepairOrder, null, null); + } catch (Exception e) { + log.error("鎺ㄩ�佷紒涓氬井淇℃秷鎭け璐ワ細" + e.getMessage(), e); + } } } @@ -287,7 +296,6 @@ List<String> nextAssignee = (List<String>) request.getValues().get("NextAssignee"); String nextAssigneeStr = nextAssignee.stream() .filter(Objects::nonNull) // 鍙�夛細杩囨护 null 鍊� - .map(item -> item.substring(2))//璁惧鍙拌处琛ㄧ淮鎶ょ殑璁惧绠$悊鍛樺伐鍙锋槸甯� WK鍓嶇紑鐨� .collect(Collectors.joining(",")); String touser = wechatEnterpriseService.getTouser(nextAssigneeStr, false); templateCard.setTouser(touser); @@ -449,7 +457,7 @@ values.put("dataId", eamRepairOrder.getId()); values.put("organization", "缁翠慨宸ュ崟杩涘叆绛夊浠剁姸鎬�"); values.put("comment", "缁翠慨宸ュ崟杩涘叆绛夊浠剁姸鎬�"); - values.put("NextAssignee", Arrays.asList(equipment.getEquipmentManager().split(","))); + values.put("NextAssignee", equipment.getEquipmentManager().split(",")); values.put("status", 1); request.setComment("缁翠慨宸ュ崟杩涘叆绛夊浠剁姸鎬�"); eamRepairOrder.setRepairStatus(ReportRepairEnum.WAIT_SPARES.name()); @@ -547,7 +555,11 @@ eamReportRepairService.updateById(eamReportRepair); if (!ReportRepairEnum.COMPLETE.name().equals(eamRepairOrder.getRepairStatus())) { //鎺ㄩ�佷紒涓氬井淇℃秷鎭紙娴佺▼瀹岀粨涓嶅彂閫佹秷鎭級 - sendQywxTemplateCardMessage(eamRepairOrder, eamReportRepair, request); + try { + sendQywxTemplateCardMessage(eamRepairOrder, eamReportRepair, request); + } catch (Exception e) { + log.error("鎺ㄩ�佷紒涓氬井淇℃秷鎭け璐ワ細" + e.getMessage(), e); + } } return eamRepairOrder; } -- Gitblit v1.9.3