浏览代码

feature 回调函数增加 日志信息

xiahan 4 月之前
父节点
当前提交
9bb2777090

+ 7 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/PayMentServiceImpl.java

@@ -122,7 +122,7 @@ public class PayMentServiceImpl implements PayMentService {
      */
     @Override
     public R prepayNotice(PrepayNoticeVo prepayNoticeVo, String dskey) {
-        log.info("获取到的回调信息接口:{}", prepayNoticeVo);
+        log.info("获取到的支付成功的回调:{},dskey:{}", prepayNoticeVo, dskey);
         List<String> dsKeys;
         if (StringUtils.isBlank(dskey)) {
             List<TenantDo> tenantList = (List<TenantDo>) redisService.getRedisCatchObj("allTenants");
@@ -149,11 +149,12 @@ public class PayMentServiceImpl implements PayMentService {
                 cipher.updateAAD(associatedData);
                 analysisStr = new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), "utf-8");
                 deKey = swEnterpriseConfigInfoDo.getTenantid();
+                log.debug("解析成功");
                 if (StringUtils.isNotBlank(analysisStr)) {
                     break;
                 }
             } catch (Exception e) {
-                log.error("当前租户:{}解密异常",swEnterpriseConfigInfoDo.getTenantid());
+                log.error("当前租户:{}解密异常", swEnterpriseConfigInfoDo.getTenantid());
             }
         }
         if (StringUtils.isBlank(analysisStr)) {
@@ -164,6 +165,7 @@ public class PayMentServiceImpl implements PayMentService {
         WeChatPayTransactionVo transaction = null;
         try {
             transaction = mapper.readValue(analysisStr, WeChatPayTransactionVo.class);
+            log.debug("实体转换成功");
         } catch (IOException e) {
             e.printStackTrace();
             log.error("JSON转换异常");
@@ -174,8 +176,10 @@ public class PayMentServiceImpl implements PayMentService {
         // 商户号
         String outTradeNo = transaction.getOutTradeNo();
         Date successTime = transaction.getSuccessTime();
+        log.debug("支付回调:{}",transaction);
+        log.error("开始更新缴费记录信息");
         // 更新缴费记录相关信息
-        swBillingRecordService.getBaseMapper().updateWeChatPayInfo(deKey, outTradeNo, transactionId, analysisStr,successTime);
+        swBillingRecordService.getBaseMapper().updateWeChatPayInfo(deKey, outTradeNo, transactionId, analysisStr, successTime);
         return R.ok();
     }
 }

+ 2 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/RefundServiceImpl.java

@@ -206,6 +206,7 @@ public class RefundServiceImpl implements RefundService {
                 cipher.updateAAD(associatedData);
                 analysisStr = new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), "utf-8");
                 deKey = swEnterpriseConfigInfoDo.getTenantid();
+                log.debug("数据解析成功");
                 if (StringUtils.isNotBlank(analysisStr)) {
                     break;
                 }
@@ -226,7 +227,7 @@ public class RefundServiceImpl implements RefundService {
             log.error("JSON转换异常");
             return R.error();
         }
-
+        log.debug("josn解析正常:{}",weChatRefundNoticeVo);
         ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
         HttpServletRequest request = attributes.getRequest();
         // 设置租户信息 自动切库