吴树波 2 тижнів тому
батько
коміт
1dd4e9bdd2

+ 8 - 7
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -501,7 +501,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
             String appId = StringUtils.isBlank(param.getAppId()) ? config.getMiniappId() : param.getAppId();
             config.setAppId(appId);
         }
-        System.out.println("最终传参"+config);
+        log.info("最终传参:{}", config);
         //组合返回参数
         R result = new R();
         // 根据 isNew 判断使用哪种发红包方式
@@ -510,9 +510,9 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
         } else {
             result= sendRedPacketLegacyInternal(param, config);
         }
-        result.put("mchId",config.getMchId()+"");
+        result.put("mchId",config.getMchId());
         result.put("isNew",config.getIsNew());
-        System.out.println("红包返回:"+result);
+        log.info("红包返回:{}", result);
         return result;
     }
 
@@ -622,13 +622,14 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
 
     @Override
     public String transferNotify(String notifyData, HttpServletRequest request) {
-        logger.info("zyp \n【收到转账回调】:{}",notifyData);
+        logger.info("zyp \n【收到转账回调V2】:{}",notifyData);
         try {
             String json = configService.selectConfigByKey("redPacket.config");
             RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
             //创建微信订单
             WxPayConfig payConfig = new WxPayConfig();
             BeanUtils.copyProperties(config,payConfig);
+            log.info("商户号配置:{}", JSON.toJSONString(payConfig));
             WxPayService wxPayService = new WxPayServiceImpl();
             wxPayService.setConfig(payConfig);
             SignatureHeader signatureHeader = new SignatureHeader();
@@ -637,7 +638,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
             signatureHeader.setSerial(request.getHeader("Wechatpay-Serial"));
             signatureHeader.setSignature(request.getHeader("Wechatpay-Signature"));
             WxPayTransferBatchesNotifyV3Result result = wxPayService.parseTransferBatchesNotifyV3Result(notifyData,signatureHeader);
-            logger.info("到零钱回调:{}",result.getResult());
+            log.info("到零钱回调:{}",result.getResult());
             if (result.getResult().getBatchStatus().equals("FINISHED") && result.getResult().getFailNum()==0) {
                 R r = redPacketLogService.syncRedPacket(result.getResult().getOutBatchNo(),result.getResult().getBatchId());
                 logger.info("result:{}",r);
@@ -650,7 +651,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
                 return WxPayNotifyResponse.fail("");
             }
         } catch (WxPayException e) {
-            logger.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
+            log.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
             return WxPayNotifyResponse.fail(e.getMessage());
         }
     }
@@ -744,7 +745,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
 
     @Override
     public String v3TransferNotify(String notifyData, HttpServletRequest request) {
-        log.info("zyp \n【收到转账回调】:{}",notifyData);
+        log.info("zyp \n【收到转账回调V3】:{}",notifyData);
         try {
             String json = configService.selectConfigByKey("redPacket.config");
             RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);

+ 4 - 25
fs-user-app/src/main/java/com/fs/app/controller/WxPayController.java

@@ -1,51 +1,30 @@
 package com.fs.app.controller;
 
 
-import cn.hutool.json.JSONUtil;
+import com.fs.common.core.controller.BaseController;
 import com.fs.company.service.ICompanyRechargeService;
 import com.fs.core.config.WxPayProperties;
-import com.fs.course.config.RedPacketConfig;
-import com.fs.course.domain.FsCourseRedPacketLog;
 import com.fs.course.service.IFsCourseProductOrderService;
 import com.fs.course.service.IFsCourseRedPacketLogService;
-import com.fs.his.param.WxSendRedPacketParam;
-import com.fs.common.core.controller.BaseController;
-
-import com.fs.common.core.domain.R;
 import com.fs.course.service.IFsUserCourseOrderService;
 import com.fs.course.service.IFsUserVipOrderService;
-import com.fs.his.domain.FsPayConfig;
 import com.fs.his.service.*;
 import com.fs.sop.service.ISopUserLogsInfoService;
-import com.fs.system.domain.SysConfig;
 import com.fs.system.service.ISysConfigService;
-import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
 import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
 import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
-import com.github.binarywang.wxpay.bean.notify.WxPayTransferBatchesNotifyV3Result;
-import com.github.binarywang.wxpay.config.WxPayConfig;
-import com.github.binarywang.wxpay.constant.WxPayConstants;
-import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
-import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
-import com.github.binarywang.wxpay.util.SignUtils;
-import com.google.gson.Gson;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import lombok.Synchronized;
-import me.chanjar.weixin.common.bean.WxJsapiSignature;
-import me.chanjar.weixin.common.error.WxErrorException;
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.HashMap;
-import java.util.Map;
 
 @Api("微信支付接口")
 @RestController