|
@@ -471,6 +471,12 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
|
break;
|
|
|
}
|
|
|
+ //H5的用公众号的appid发,小程序的用小程序的appid来发
|
|
|
+ if (param.getSource()==2){
|
|
|
+ // 传参appId为空时,仍然使用配置里面的
|
|
|
+ String appId = StringUtils.isBlank(param.getAppId()) ? config.getMiniappId() : param.getAppId();
|
|
|
+ config.setAppId(appId);
|
|
|
+ }
|
|
|
System.out.println("最终传参"+config);
|
|
|
//组合返回参数
|
|
|
R result = new R();
|
|
@@ -495,12 +501,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
TransferService transferService = wxPayService.getTransferService();
|
|
|
|
|
|
TransferBillsRequest request = new TransferBillsRequest();
|
|
|
- if(param.getSource()==2){
|
|
|
- request.setAppid(config.getMiniappId());
|
|
|
- }else {
|
|
|
- request.setAppid(config.getAppId());
|
|
|
- }
|
|
|
-
|
|
|
+ request.setAppid(config.getAppId());
|
|
|
request.setOpenid(param.getOpenId());
|
|
|
|
|
|
String code = String.valueOf(IdUtil.getSnowflake(0, 0).nextId());
|
|
@@ -547,11 +548,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
TransferService transferService = wxPayService.getTransferService();
|
|
|
|
|
|
TransferBatchesRequest request = new TransferBatchesRequest();
|
|
|
- if (param.getSource() == 2){
|
|
|
- request.setAppid(config.getMiniappId());
|
|
|
- }else {
|
|
|
- request.setAppid(config.getAppId());
|
|
|
- }
|
|
|
+ request.setAppid(config.getAppId());
|
|
|
|
|
|
String code = IdUtil.getSnowflake(0, 0).nextIdStr();
|
|
|
request.setOutBatchNo("fsCourse" + code);
|