|
|
@@ -940,6 +940,50 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 分公司配置回调地址
|
|
|
+ * @param companyId
|
|
|
+ * @param notifyData
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String TransferNotifyWithCompanyId(Long companyId,String notifyData, HttpServletRequest request) {
|
|
|
+ logger.info("分公司回调::companyId:{}",companyId);
|
|
|
+ logger.info("zyp \n【收到转账回调::分公司】:{}",notifyData);
|
|
|
+ try {
|
|
|
+ String json = companyConfigMapper.selectRedPacketConfigByKey(companyId);
|
|
|
+// String json = configService.selectConfigByKey("redPacket.config");
|
|
|
+ RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
|
+ //创建微信订单
|
|
|
+ WxPayConfig payConfig = new WxPayConfig();
|
|
|
+ BeanUtils.copyProperties(config,payConfig);
|
|
|
+ WxPayService wxPayService = new WxPayServiceImpl();
|
|
|
+ wxPayService.setConfig(payConfig);
|
|
|
+ SignatureHeader signatureHeader = new SignatureHeader();
|
|
|
+ signatureHeader.setTimeStamp(request.getHeader("Wechatpay-Timestamp"));
|
|
|
+ signatureHeader.setNonce(request.getHeader("Wechatpay-Nonce"));
|
|
|
+ signatureHeader.setSerial(request.getHeader("Wechatpay-Serial"));
|
|
|
+ signatureHeader.setSignature(request.getHeader("Wechatpay-Signature"));
|
|
|
+ WxPayTransferBatchesNotifyV3Result result = wxPayService.parseTransferBatchesNotifyV3Result(notifyData,signatureHeader);
|
|
|
+ logger.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);
|
|
|
+ if (r.get("code").equals(200)){
|
|
|
+ return WxPayNotifyResponse.success("处理成功");
|
|
|
+ }else {
|
|
|
+ return WxPayNotifyResponse.fail("");
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ return WxPayNotifyResponse.fail("");
|
|
|
+ }
|
|
|
+ } catch (WxPayException e) {
|
|
|
+ logger.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
|
|
|
+ return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Boolean isEntityNull(FsStorePaymentParam param) {
|
|
|
if (param == null) {
|