From 9178d6123fe3ea159605a9a617a47d1685e71ea8 Mon Sep 17 00:00:00 2001 From: mzr Date: Wed, 16 Apr 2025 14:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B0=E8=B4=A6=E9=80=9A=E7=9F=A5=E5=8F=91?= =?UTF-8?q?=E5=B8=83-=E6=8E=A8=E9=80=81=E6=8C=89=E9=92=AE=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../informer/action/myBtnClickAction.java | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/cmp/src/client/nccloud/web/cmp/informer/informer/action/myBtnClickAction.java b/cmp/src/client/nccloud/web/cmp/informer/informer/action/myBtnClickAction.java index 20eab06..64d0734 100644 --- a/cmp/src/client/nccloud/web/cmp/informer/informer/action/myBtnClickAction.java +++ b/cmp/src/client/nccloud/web/cmp/informer/informer/action/myBtnClickAction.java @@ -9,6 +9,8 @@ import nc.jdbc.framework.PersistenceManager; import nc.jdbc.framework.exception.DbException; import nc.jdbc.framework.processor.MapListProcessor; import nc.jdbc.framework.processor.MapProcessor; +import nccloud.commons.lang.StringUtils; +import nccloud.framework.core.exception.ExceptionUtils; import nccloud.framework.service.ServiceLocator; import nccloud.framework.web.action.itf.ICommonAction; import nccloud.framework.web.container.IRequest; @@ -172,7 +174,7 @@ public class myBtnClickAction extends InformerAction implements ICommonAction { "left join bd_cust_supplier df on cmp.pk_oppunit=df.pk_cust_sup " + "left join org_financeorg org on cmp.pk_org = org.pk_financeorg " + "left join bd_balatype jstype on jstype.pk_balatype =cmp.pk_balatype " + - "left join bd_currtype bz on cmp.pk_currtype=bz.pk_currtype"+ + "left join bd_currtype bz on cmp.pk_currtype=bz.pk_currtype" + " where cmp.pk_informer in(" + result + ") "; List> results = (List>) getQueryService().executeQuery(sql, new MapListProcessor()); @@ -188,18 +190,16 @@ public class myBtnClickAction extends InformerAction implements ICommonAction { } if ("撤回".equals(def01)) { vmao.put("publishStatus", "再次发布"); - } else { vmao.put("publishStatus", ""); - } String pjlsh; if (row.get("transerial") != null) { - pjlsh = row.get("transerial").toString(); + pjlsh = row.get("transerial"); } else if (row.get("note_no") != null) { - pjlsh = row.get("note_no").toString(); + pjlsh = row.get("note_no"); } else { resultMap.put("flag", "false"); resultMap.put("message", "票据与流水号不可同时为空"); @@ -211,20 +211,23 @@ public class myBtnClickAction extends InformerAction implements ICommonAction { vmao.put("bankNum", row.get("accnum")); vmao.put("transactionDate", row.get("infodate")); vmao.put("paymentReceiptStatus", row.get("direction")); - vmao.put("currencyCode", row.get("nzcode") ); + vmao.put("currencyCode", row.get("nzcode")); vmao.put("transactionAmount", row.get("moneyy")); vmao.put("pendingClaimAmount", 0); vmao.put("oppAccount", row.get("oppbankaccount")); vmao.put("oppAccountName", row.get("oppunitname")); vmao.put("oppBank", row.get("dfcode")); vmao.put("oppBankName", row.get("dfname")); - vmao.put("description", row.get("memo")); + vmao.put("description", "--"); + if (StringUtils.isNotEmpty(row.get("memo"))) { + vmao.put("description", row.get("memo")); + } vmao.put("bankTransactionNumber", pjlsh); vmao.put("accountType", "默认类型"); vmao.put("orgCode", row.get("orgcode")); vmao.put("billNumber", row.get("note_no")); - if (row.get("pk_balatype") != null && row.get("pk_balatype") != "" && row.get("pk_balatype") != "~") { + if (row.get("pk_balatype") != null && !Objects.equals(row.get("pk_balatype"), "") && !Objects.equals(row.get("pk_balatype"), "~")) { vmao.put("paymentMethod", row.get("pk_balatype")); } else { vmao.put("paymentMethod", "10"); @@ -238,6 +241,10 @@ public class myBtnClickAction extends InformerAction implements ICommonAction { Map access_token = (Map) map.get("data"); String urls2 = urlpath + "/iuap-api-gateway/" + tenant + "/current_yonbip_default_sys/KKAPI/paymentNotice/addBatch?access_token=" + access_token.get("access_token"); Map mapjson = httpFW(urls2, jsonString1); + Logger.error("myBtnClickAction-mapjson = " + mapjson); + if (!"200".equals(mapjson.getOrDefault("code", "") + "")) { + throw new Exception(mapjson.getOrDefault("message", "推送失败") + ""); + } Map datas = (Map) mapjson.get("data"); JSONArray faijsonist = (JSONArray) datas.get("failData"); @@ -273,17 +280,13 @@ public class myBtnClickAction extends InformerAction implements ICommonAction { String message = datas.get("successData") + "成功" + message1 + ",失败:" + failData; resultMap.put("flag", "true"); resultMap.put("message", message); - // 调用服务工具类的deletePrcplInterest方法,尝试删除利息计划 - System.out.println("year" + mapjson); ins.close(); } catch (Exception ex) { // 捕获异常,并记录错误日志 - Logger.error("123" + ex.getMessage(), ex); - resultMap.put("flag", "0"); - resultMap.put("message", ex.getMessage()); + Logger.error("myBtnClickAction-exp:" + ex.getMessage(), ex); + ExceptionUtils.wrapBusinessException(ex.getMessage()); } - // 返回结果映射 return resultMap; } @@ -300,7 +303,7 @@ public class myBtnClickAction extends InformerAction implements ICommonAction { hmacSHA256.init(secretKey); byte[] hashBytes = hmacSHA256.doFinal(data.getBytes()); String base64Hash = Base64.encodeBase64String(hashBytes); - return URLEncoder.encode(base64Hash, StandardCharsets.UTF_8.toString()); + return URLEncoder.encode(base64Hash, StandardCharsets.UTF_8); }