|
@@ -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;
|
|
@@ -2025,19 +2026,37 @@ 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");
|
|
|
|
|
+ }
|
|
|
|
|
+ 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;
|
|
|
}
|
|
}
|