|
|
@@ -31,6 +31,8 @@ import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
|
import com.fs.core.config.WxPayProperties;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
+import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
|
+import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
|
|
|
import com.fs.event.TemplateBean;
|
|
|
import com.fs.event.TemplateEvent;
|
|
|
import com.fs.event.TemplateListenEnum;
|
|
|
@@ -119,6 +121,10 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
@Autowired
|
|
|
private RocketMQTemplate rocketMQTemplate;
|
|
|
@Autowired
|
|
|
+ private FsCoursePlaySourceConfigMapper fsCoursePlaySourceConfigMapper;
|
|
|
+ @Autowired
|
|
|
+ private MerchantAppConfigMapper merchantAppConfigMapper;
|
|
|
+ @Autowired
|
|
|
private TzBankService tzBankService;
|
|
|
@Autowired
|
|
|
private ApplicationEventPublisher publisher;
|
|
|
@@ -326,9 +332,20 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
FsStorePayment payment=payments.get(0);
|
|
|
if(payment.getPayMode().equals("wx")){
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
- SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
- FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
- payConfig.setAppId(fsPayConfig.getAppId());
|
|
|
+ if (StringUtils.isBlank(param.getAppId())) {
|
|
|
+ throw new IllegalArgumentException("appId不能为空");
|
|
|
+ }
|
|
|
+ FsCoursePlaySourceConfig fsCoursePlaySourceConfig = fsCoursePlaySourceConfigMapper.selectCoursePlaySourceConfigByAppId(param.getAppId());
|
|
|
+ if (fsCoursePlaySourceConfig == null) {
|
|
|
+ throw new CustomException("未找到appId对应的小程序配置: " + param.getAppId());
|
|
|
+ }
|
|
|
+ Long merchantConfigId = fsCoursePlaySourceConfig.getMerchantConfigId();
|
|
|
+ if (merchantConfigId == null || merchantConfigId <= 0) {
|
|
|
+ throw new CustomException("小程序没有配置商户信息");
|
|
|
+ }
|
|
|
+ MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigById(fsCoursePlaySourceConfig.getMerchantConfigId());
|
|
|
+ FsPayConfig fsPayConfig = com.hc.openapi.tool.fastjson.JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
+ payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
|
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
|
payConfig.setMchKey(fsPayConfig.getWxMchKey());
|
|
|
|
|
|
@@ -1484,9 +1501,20 @@ public class FsInquiryOrderServiceImpl implements IFsInquiryOrderService
|
|
|
|
|
|
if(payment.getPayMode().equals("wx")){
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
- SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
- FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
- payConfig.setAppId(fsPayConfig.getAppId());
|
|
|
+ if (StringUtils.isBlank(param.getAppId())) {
|
|
|
+ throw new IllegalArgumentException("appId不能为空");
|
|
|
+ }
|
|
|
+ FsCoursePlaySourceConfig fsCoursePlaySourceConfig = fsCoursePlaySourceConfigMapper.selectCoursePlaySourceConfigByAppId(param.getAppId());
|
|
|
+ if (fsCoursePlaySourceConfig == null) {
|
|
|
+ throw new CustomException("未找到appId对应的小程序配置: " + param.getAppId());
|
|
|
+ }
|
|
|
+ Long merchantConfigId = fsCoursePlaySourceConfig.getMerchantConfigId();
|
|
|
+ if (merchantConfigId == null || merchantConfigId <= 0) {
|
|
|
+ throw new CustomException("小程序没有配置商户信息");
|
|
|
+ }
|
|
|
+ MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigById(fsCoursePlaySourceConfig.getMerchantConfigId());
|
|
|
+ FsPayConfig fsPayConfig = com.hc.openapi.tool.fastjson.JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
|
|
|
+ payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
|
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
|
payConfig.setMchKey(fsPayConfig.getWxMchKey());
|
|
|
|