|
|
@@ -11,10 +11,8 @@ import com.fs.company.service.ICompanyDivConfigService;
|
|
|
import com.fs.company.service.ICompanyDivItemService;
|
|
|
import com.fs.company.service.impl.CompanyDivConfigServiceImpl;
|
|
|
import com.fs.company.vo.CompanyDivConfigVo;
|
|
|
-import com.fs.his.domain.FsPackageOrder;
|
|
|
-import com.fs.his.domain.FsPayConfig;
|
|
|
-import com.fs.his.domain.FsStoreOrder;
|
|
|
-import com.fs.his.domain.FsStorePayment;
|
|
|
+import com.fs.his.domain.*;
|
|
|
+import com.fs.his.mapper.FsHfpayConfigMapper;
|
|
|
import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.mapper.SysConfigMapper;
|
|
|
@@ -41,7 +39,17 @@ public class HuiFuUtils {
|
|
|
SysConfigMapper sysConfigMapper= SpringUtils.getBean(SysConfigMapper.class);
|
|
|
SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
+
|
|
|
+ // 根据appId动态获取主商户号
|
|
|
String defaultHuifuId = fsPayConfig.getHuifuId();
|
|
|
+ if (StringUtils.isNotBlank(huiFuCreateOrder.getAppId())) {
|
|
|
+ // 如果有appId,查询对应的汇付支付配置
|
|
|
+ FsHfpayConfigMapper fsHfpayConfigMapper = SpringUtils.getBean(com.fs.his.mapper.FsHfpayConfigMapper.class);
|
|
|
+ FsHfpayConfig fsHfpayConfig = fsHfpayConfigMapper.selectByAppId(huiFuCreateOrder.getAppId());
|
|
|
+ if (fsHfpayConfig != null && StringUtils.isNotBlank(fsHfpayConfig.getHuifuId())) {
|
|
|
+ defaultHuifuId = fsHfpayConfig.getHuifuId();
|
|
|
+ }
|
|
|
+ }
|
|
|
//查询是否开启分账
|
|
|
if (companyId !=null){
|
|
|
|
|
|
@@ -90,6 +98,13 @@ public class HuiFuUtils {
|
|
|
defaultAccount.put("percentage_div", String.format("%.2f", 100f - total));
|
|
|
defaultAccount.put("huifu_id", defaultHuifuId);
|
|
|
acctInfos.add(defaultAccount);
|
|
|
+ } else {
|
|
|
+ // 即使没有其他分账接收方,也要包含主商户号,分账比例为0
|
|
|
+ acctInfos = new ArrayList<>();
|
|
|
+ Map<String, Object> defaultAccount = new HashMap<>();
|
|
|
+ defaultAccount.put("percentage_div", "0.00");
|
|
|
+ defaultAccount.put("huifu_id", defaultHuifuId);
|
|
|
+ acctInfos.add(defaultAccount);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -126,6 +141,13 @@ public class HuiFuUtils {
|
|
|
defaultAccount.put("huifu_id", defaultHuifuId);
|
|
|
acctInfos.add(defaultAccount);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ // 即使没有其他分账接收方,也要包含主商户号,分账金额为0
|
|
|
+ acctInfos = new ArrayList<>();
|
|
|
+ Map<String, Object> defaultAccount = new HashMap<>();
|
|
|
+ defaultAccount.put("div_amt", "0.00");
|
|
|
+ defaultAccount.put("huifu_id", defaultHuifuId);
|
|
|
+ acctInfos.add(defaultAccount);
|
|
|
}
|
|
|
|
|
|
}
|