|
@@ -39,6 +39,7 @@ import com.fs.company.vo.FsStorePaymentStatisticsVO;
|
|
|
import com.fs.config.cloud.CloudHostProper;
|
|
import com.fs.config.cloud.CloudHostProper;
|
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
|
|
+import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.config.RedPacketConfig;
|
|
import com.fs.course.config.RedPacketConfig;
|
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
|
import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
@@ -416,6 +417,12 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
vipOrderService.payConfirm("", fsStorePayment.getPayCode(), fsStorePayment.getTradeNo(), "", 1,queryOrderResult.getOut_trans_id(),queryOrderResult.getParty_order_id());
|
|
vipOrderService.payConfirm("", fsStorePayment.getPayCode(), fsStorePayment.getTradeNo(), "", 1,queryOrderResult.getOut_trans_id(),queryOrderResult.getParty_order_id());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ }else if (queryOrderResult.getTrans_stat().equals("F") && queryOrderResult.getBank_code().equals("TRADE_CLOSED")) {
|
|
|
|
|
+ FsStorePayment paymentMap = new FsStorePayment();
|
|
|
|
|
+ paymentMap.setPaymentId(paymentId);
|
|
|
|
|
+ paymentMap.setStatus(2);
|
|
|
|
|
+ paymentMap.setPayTime(new Date());
|
|
|
|
|
+ fsStorePaymentMapper.updateFsStorePayment(paymentMap);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1121,105 +1128,166 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
@Override
|
|
@Override
|
|
|
public String v3TransferNotify(String notifyData, HttpServletRequest request) {
|
|
public String v3TransferNotify(String notifyData, HttpServletRequest request) {
|
|
|
logger.info("zyp \n【收到转账回调V3】:{}",notifyData);
|
|
logger.info("zyp \n【收到转账回调V3】:{}",notifyData);
|
|
|
- try {
|
|
|
|
|
- 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"));
|
|
|
|
|
- TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
|
|
- logger.info("到零钱回调1:{}",result.getResult());
|
|
|
|
|
- if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
|
|
- R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
|
|
- logger.info("result:{}",r);
|
|
|
|
|
- if (r.get("code").equals(200)){
|
|
|
|
|
- return WxPayNotifyResponse.success("处理成功");
|
|
|
|
|
- }else {
|
|
|
|
|
- return WxPayNotifyResponse.fail("");
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
- return WxPayNotifyResponse.fail("");
|
|
|
|
|
- }
|
|
|
|
|
- } catch (WxPayException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- logger.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
|
|
|
|
|
- return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String json = configService.selectConfigByKey("redPacket.config");
|
|
|
|
|
+ return handleTransferV3Notify(json,notifyData,request);
|
|
|
|
|
+// try {
|
|
|
|
|
+// 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"));
|
|
|
|
|
+// TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
|
|
+// logger.info("到零钱回调1:{}",result.getResult());
|
|
|
|
|
+// if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
|
|
+// R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
|
|
+// logger.info("result:{}",r);
|
|
|
|
|
+// if (r.get("code").equals(200)){
|
|
|
|
|
+// return WxPayNotifyResponse.success("处理成功");
|
|
|
|
|
+// }else {
|
|
|
|
|
+// return WxPayNotifyResponse.fail("");
|
|
|
|
|
+// }
|
|
|
|
|
+// }else {
|
|
|
|
|
+// return WxPayNotifyResponse.fail("");
|
|
|
|
|
+// }
|
|
|
|
|
+// } catch (WxPayException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// logger.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
|
|
|
|
|
+// return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String v3TransferNotifyApp(String notifyData, HttpServletRequest request) {
|
|
public String v3TransferNotifyApp(String notifyData, HttpServletRequest request) {
|
|
|
logger.info("zyp \n【app-收到转账回调V3】:{}",notifyData);
|
|
logger.info("zyp \n【app-收到转账回调V3】:{}",notifyData);
|
|
|
- try {
|
|
|
|
|
- String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
- 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"));
|
|
|
|
|
- TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
|
|
- logger.info("app-到零钱回调:{}",result.getResult());
|
|
|
|
|
- if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
|
|
- R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
|
|
- logger.info("app,result:{}",r);
|
|
|
|
|
- if (r.get("code").equals(200)){
|
|
|
|
|
- return WxPayNotifyResponse.success("处理成功");
|
|
|
|
|
- }else {
|
|
|
|
|
- return WxPayNotifyResponse.fail("");
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
- return WxPayNotifyResponse.fail("");
|
|
|
|
|
- }
|
|
|
|
|
- } catch (WxPayException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- logger.error("zyp \n【app-转账回调异常】:{}", e.getReturnMsg());
|
|
|
|
|
- return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
+ return handleTransferV3Notify(json,notifyData,request);
|
|
|
|
|
+// try {
|
|
|
|
|
+// String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
+// 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"));
|
|
|
|
|
+// TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
|
|
+// logger.info("app-到零钱回调:{}",result.getResult());
|
|
|
|
|
+// if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
|
|
+// R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
|
|
+// logger.info("app,result:{}",r);
|
|
|
|
|
+// if (r.get("code").equals(200)){
|
|
|
|
|
+// return WxPayNotifyResponse.success("处理成功");
|
|
|
|
|
+// }else {
|
|
|
|
|
+// return WxPayNotifyResponse.fail("");
|
|
|
|
|
+// }
|
|
|
|
|
+// }else {
|
|
|
|
|
+// return WxPayNotifyResponse.fail("");
|
|
|
|
|
+// }
|
|
|
|
|
+// } catch (WxPayException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// logger.error("zyp \n【app-转账回调异常】:{}", e.getReturnMsg());
|
|
|
|
|
+// return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String v3TransferNotifyWithCompanyId(Long companyId, String notifyData, HttpServletRequest request) {
|
|
public String v3TransferNotifyWithCompanyId(Long companyId, String notifyData, HttpServletRequest request) {
|
|
|
logger.info("分公司回调V3::companyId:{}",companyId);
|
|
logger.info("分公司回调V3::companyId:{}",companyId);
|
|
|
logger.info("zyp \n【收到转账回调V3::分公司】:{}",notifyData);
|
|
logger.info("zyp \n【收到转账回调V3::分公司】:{}",notifyData);
|
|
|
|
|
+ String json = companyConfigService.selectRedPacketConfigByKey(companyId);
|
|
|
|
|
+ return handleTransferV3Notify(json,notifyData,request);
|
|
|
|
|
+// try {
|
|
|
|
|
+//// String json = configService.selectConfigByKey("redPacket.config");
|
|
|
|
|
+// String json = companyConfigService.selectRedPacketConfigByKey(companyId);
|
|
|
|
|
+// 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"));
|
|
|
|
|
+// TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
|
|
+// logger.info("到零钱回调1:{}",result.getResult());
|
|
|
|
|
+// if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
|
|
+// R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
|
|
+// logger.info("result:{}",r);
|
|
|
|
|
+// if (r.get("code").equals(200)){
|
|
|
|
|
+// return WxPayNotifyResponse.success("处理成功");
|
|
|
|
|
+// }else {
|
|
|
|
|
+// return WxPayNotifyResponse.fail("");
|
|
|
|
|
+// }
|
|
|
|
|
+// }else {
|
|
|
|
|
+// return WxPayNotifyResponse.fail("");
|
|
|
|
|
+// }
|
|
|
|
|
+// } catch (WxPayException e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// logger.error("zyp \n【转账回调异常】:{}", e.getReturnMsg());
|
|
|
|
|
+// return WxPayNotifyResponse.fail(e.getMessage());
|
|
|
|
|
+// }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String v3TransferNotifyWithCompanyIdApp(Long companyId, String notifyData, HttpServletRequest request) {
|
|
|
|
|
+ logger.info("分公司回调V3app::app的companyId:{}",companyId);
|
|
|
|
|
+ logger.info("zyp \n【app收到转账回调V3::分公司】:{}",notifyData);
|
|
|
|
|
+
|
|
|
|
|
+ String json = companyConfigService.selectRedPacketConfigByKeyApp(companyId);
|
|
|
|
|
+
|
|
|
|
|
+ return handleTransferV3Notify(json,notifyData,request);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private String handleTransferV3Notify(String json, String notifyData, HttpServletRequest request) {
|
|
|
|
|
+ logger.info("zyp \n【收到转账回调V3】:{}", notifyData);
|
|
|
try {
|
|
try {
|
|
|
-// String json = configService.selectConfigByKey("redPacket.config");
|
|
|
|
|
- String json = companyConfigService.selectRedPacketConfigByKey(companyId);
|
|
|
|
|
|
|
+
|
|
|
RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
|
|
|
|
|
|
//创建微信订单
|
|
//创建微信订单
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
- BeanUtils.copyProperties(config,payConfig);
|
|
|
|
|
|
|
+ BeanUtils.copyProperties(config, payConfig);
|
|
|
WxPayService wxPayService = new WxPayServiceImpl();
|
|
WxPayService wxPayService = new WxPayServiceImpl();
|
|
|
wxPayService.setConfig(payConfig);
|
|
wxPayService.setConfig(payConfig);
|
|
|
|
|
+
|
|
|
SignatureHeader signatureHeader = new SignatureHeader();
|
|
SignatureHeader signatureHeader = new SignatureHeader();
|
|
|
signatureHeader.setTimeStamp(request.getHeader("Wechatpay-Timestamp"));
|
|
signatureHeader.setTimeStamp(request.getHeader("Wechatpay-Timestamp"));
|
|
|
signatureHeader.setNonce(request.getHeader("Wechatpay-Nonce"));
|
|
signatureHeader.setNonce(request.getHeader("Wechatpay-Nonce"));
|
|
|
signatureHeader.setSerial(request.getHeader("Wechatpay-Serial"));
|
|
signatureHeader.setSerial(request.getHeader("Wechatpay-Serial"));
|
|
|
signatureHeader.setSignature(request.getHeader("Wechatpay-Signature"));
|
|
signatureHeader.setSignature(request.getHeader("Wechatpay-Signature"));
|
|
|
- TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData,signatureHeader);
|
|
|
|
|
- logger.info("到零钱回调1:{}",result.getResult());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ TransferBillsNotifyResult result = wxPayService.parseTransferBillsNotifyV3Result(notifyData, signatureHeader);
|
|
|
|
|
+ logger.info("到零钱回调1:{}", result.getResult());
|
|
|
|
|
+
|
|
|
if (result.getResult().getState().equals("SUCCESS")) {
|
|
if (result.getResult().getState().equals("SUCCESS")) {
|
|
|
- R r = redPacketLogService.syncRedPacket(result.getResult().getOutBillNo(),result.getResult().getTransferBillNo());
|
|
|
|
|
- logger.info("result:{}",r);
|
|
|
|
|
- if (r.get("code").equals(200)){
|
|
|
|
|
|
|
+ R r = redPacketLogService.syncRedPacket(
|
|
|
|
|
+ result.getResult().getOutBillNo(),
|
|
|
|
|
+ result.getResult().getTransferBillNo()
|
|
|
|
|
+ );
|
|
|
|
|
+ logger.info("result:{}", r);
|
|
|
|
|
+
|
|
|
|
|
+ if (r.get("code").equals(200)) {
|
|
|
return WxPayNotifyResponse.success("处理成功");
|
|
return WxPayNotifyResponse.success("处理成功");
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
return WxPayNotifyResponse.fail("");
|
|
return WxPayNotifyResponse.fail("");
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
return WxPayNotifyResponse.fail("");
|
|
return WxPayNotifyResponse.fail("");
|
|
|
}
|
|
}
|
|
|
} catch (WxPayException e) {
|
|
} catch (WxPayException e) {
|
|
@@ -1306,12 +1374,12 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
FsPayConfig payConfig=new FsPayConfig();
|
|
FsPayConfig payConfig=new FsPayConfig();
|
|
|
- //支付宝可以不需要appid(在没有appid的情况下)【ps:小程序的支付宝没传appid 就G】
|
|
|
|
|
- if (PaymentMethodEnum.ALIPAY==payOrderParam.getPaymentMethod() && StringUtils.isBlank(payOrderParam.getAppId())){
|
|
|
|
|
- String json = configService.selectConfigByKey("his.pay");
|
|
|
|
|
- PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
|
|
|
|
|
- payConfig.setType(payConfigDTO.getType());
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+// //支付宝可以不需要appid(在没有appid的情况下)【ps:小程序的支付宝没传appid 就G】
|
|
|
|
|
+// if (PaymentMethodEnum.ALIPAY==payOrderParam.getPaymentMethod() && StringUtils.isBlank(payOrderParam.getAppId())){
|
|
|
|
|
+// String json = configService.selectConfigByKey("his.pay");
|
|
|
|
|
+// PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
|
|
|
|
|
+// payConfig.setType(payConfigDTO.getType());
|
|
|
|
|
+// }else {
|
|
|
if (StringUtils.isBlank(payOrderParam.getAppId())) {
|
|
if (StringUtils.isBlank(payOrderParam.getAppId())) {
|
|
|
throw new IllegalArgumentException("appId不能为空");
|
|
throw new IllegalArgumentException("appId不能为空");
|
|
|
}
|
|
}
|
|
@@ -1330,7 +1398,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
|
|
payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
|
|
|
|
|
|
|
|
logger.debug("支付配置 his.pay: {}", payConfig);
|
|
logger.debug("支付配置 his.pay: {}", payConfig);
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1964,19 +2032,38 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional
|
|
@Transactional
|
|
|
- public R sendAppRedPacket(WxSendRedPacketParam param) {
|
|
|
|
|
|
|
+ public R sendAppRedPacket(WxSendRedPacketParam param, CourseConfig config) {
|
|
|
//组合返回参数
|
|
//组合返回参数
|
|
|
R result = new R();
|
|
R result = new R();
|
|
|
- String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
- AppRedPacketConfig config = JSONUtil.toBean(json, AppRedPacketConfig.class);
|
|
|
|
|
- if (config.getIsNew() != null && config.getIsNew() == 1) {
|
|
|
|
|
- result = sendRedPacketV3(param, config);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String json;
|
|
|
|
|
+ // 根据红包模式获取配置
|
|
|
|
|
+ switch (config.getRedPacketMode()){
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ json = companyConfigService.selectRedPacketConfigByKeyApp(param.getCompanyId());
|
|
|
|
|
+ //如果分公司配置为空就走总后台的配置
|
|
|
|
|
+ if (StringUtils.isEmpty(json)){
|
|
|
|
|
+// json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
+ throw new UnsupportedOperationException("销售公司红包配置为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ throw new UnsupportedOperationException("当前红包模式不支持!");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// String json = configService.selectConfigByKey("his.AppRedPacket");
|
|
|
|
|
+ AppRedPacketConfig appRedConfig = JSONUtil.toBean(json, AppRedPacketConfig.class);
|
|
|
|
|
+ if (appRedConfig.getIsNew() != null && appRedConfig.getIsNew() == 1) {
|
|
|
|
|
+ result = sendRedPacketV3(param, appRedConfig);
|
|
|
} else {
|
|
} else {
|
|
|
- result= sendRedPacketLegacy(param, config);
|
|
|
|
|
|
|
+ result= sendRedPacketLegacy(param, appRedConfig);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- result.put("mchId", config.getMchId());
|
|
|
|
|
- result.put("isNew",config.getIsNew());
|
|
|
|
|
|
|
+ result.put("mchId", appRedConfig.getMchId());
|
|
|
|
|
+ result.put("isNew",appRedConfig.getIsNew());
|
|
|
logger.info("App提现返回:{}",result);
|
|
logger.info("App提现返回:{}",result);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|