|
@@ -103,6 +103,9 @@ public class WechatLogic {
|
|
|
@Autowired
|
|
|
CommonLogic commonLogic;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ WorkerOrderService workerOrderService;
|
|
|
+
|
|
|
/**
|
|
|
* 微信支付服务
|
|
|
*
|
|
@@ -1270,7 +1273,7 @@ public class WechatLogic {
|
|
|
|
|
|
WxPayMicropayResult payResult = null;
|
|
|
try {
|
|
|
-
|
|
|
+ this.addShareReveiverWorker(id);
|
|
|
payResult = payService.micropay(request);
|
|
|
log.info("商户扫码支付生成订单响应: {}", payResult);
|
|
|
} catch (WxPayException e) {
|
|
@@ -1292,9 +1295,20 @@ public class WechatLogic {
|
|
|
|
|
|
AdminCompanyWechatPayConfig adminCompanyWechatPayConfig = adminCompanyWechatPayConfigService.getById(configId);
|
|
|
this.addPayWebsitRecord(adminCompanyWechatPayConfig, payment, "", payResult.getSubOpenid(), ip, payResult.getTradeType(), id, payResult.getTransactionId(), payResult.getOpenid());
|
|
|
+
|
|
|
return payResult.getTransactionId();
|
|
|
}
|
|
|
|
|
|
+ private void addShareReveiverWorker(String id) {
|
|
|
+ WorkerOrder workerOrder = workerOrderService.getById(id);
|
|
|
+
|
|
|
+ if (workerOrder != null){
|
|
|
+ //添加分账人
|
|
|
+ if (!StringUtil.isEmpty(workerOrder.getOpenId()) && !StringUtil.isEmpty(workerOrder.getConfigId()))
|
|
|
+ this.addShareReveiver(workerOrder.getOpenId(), workerOrder.getConfigId(), "B");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public PayDetail paymentWebsitH5(String orderId, BigDecimal payAmount, String openId, String profitSharingFlag, String ip, String companyWechatId) throws WxPayException {
|
|
|
return this.paymentWebsit(orderId, payAmount, openId, profitSharingFlag, ip, companyWechatId, "MWEB", false);
|
|
|
}
|