|
@@ -13,7 +13,9 @@ import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
+import com.fs.common.utils.spring.SpringUtils;
|
|
|
import com.fs.company.service.ICompanyService;
|
|
|
+import com.fs.config.cloud.CloudHostProper;
|
|
|
import com.fs.core.config.WxPayProperties;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
import com.fs.erp.constant.AfterSalesOrderStatusEnum;
|
|
@@ -190,6 +192,9 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
@Autowired
|
|
|
private IFsStoreOrderLogsService fsStoreOrderLogsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CloudHostProper cloudHostProper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询售后记录
|
|
|
*
|
|
@@ -737,10 +742,24 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
return R.error("退款请求失败"+e.getErrCodeDes());
|
|
|
}
|
|
|
}else if (payment.getPayMode()!=null&&payment.getPayMode().equals("hf")){
|
|
|
+ String huifuId="";
|
|
|
+ FsHfpayConfigMapper fsHfpayConfigMapper = SpringUtils.getBean(FsHfpayConfigMapper.class);
|
|
|
+ if (payment.getAppId() != null) {
|
|
|
+ FsHfpayConfig fsHfpayConfig = fsHfpayConfigMapper.selectByAppId(payment.getAppId());
|
|
|
+ huifuId = fsHfpayConfig.getHuifuId();
|
|
|
+ } else {
|
|
|
+ if (("益善缘".equals(cloudHostProper.getCompanyName()))) {
|
|
|
+
|
|
|
+ FsHfpayConfig fsPayConfig2 = fsHfpayConfigMapper.selectByAppId("wx0d1a3dd485268521");
|
|
|
+ huifuId = fsPayConfig2.getHuifuId();
|
|
|
+ }else {
|
|
|
+ huifuId=fsPayConfig.getHuifuId();
|
|
|
+ }
|
|
|
+ }
|
|
|
V2TradePaymentScanpayRefundRequest request = new V2TradePaymentScanpayRefundRequest();
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
request.setOrgHfSeqId(payment.getTradeNo());
|
|
|
- request.setHuifuId(fsPayConfig.getHuifuId());
|
|
|
+ request.setHuifuId(huifuId);
|
|
|
request.setOrdAmt(df.format(refundAmount));
|
|
|
request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
|
|
|
request.setReqSeqId("refund-"+payment.getPayCode());
|
|
@@ -1366,11 +1385,12 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
}
|
|
|
if (payments != null && payments.size() > 0) {
|
|
|
FsStorePaymentScrm payment = payments.get(0);
|
|
|
- String json = configService.selectConfigByKey("his.pay");
|
|
|
+ String json = configService.selectConfigByKey("store.pay");
|
|
|
+ FsPayConfigScrm fsPayConfig = JSON.parseObject(json, FsPayConfigScrm.class);
|
|
|
if (payment.getPayMode().equals("wx")) {
|
|
|
WxPayConfig payConfig = new WxPayConfig();
|
|
|
- SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
- FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
+ //SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
|
|
|
+ //FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
|
|
|
payConfig.setAppId(fsPayConfig.getAppId());
|
|
|
payConfig.setMchId(fsPayConfig.getWxMchId());
|
|
|
payConfig.setMchKey(fsPayConfig.getWxMchKey());
|
|
@@ -1442,8 +1462,23 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
throw new CustomException("退款请求失败" + result.getRetMsg());
|
|
|
}
|
|
|
} else if (payment.getPayMode().equals("hf")) {
|
|
|
+ String huifuId="";
|
|
|
+ FsHfpayConfigMapper fsHfpayConfigMapper = SpringUtils.getBean(FsHfpayConfigMapper.class);
|
|
|
+ if (payment.getAppId() != null) {
|
|
|
+ FsHfpayConfig fsHfpayConfig = fsHfpayConfigMapper.selectByAppId(payment.getAppId());
|
|
|
+ huifuId = fsHfpayConfig.getHuifuId();
|
|
|
+ } else {
|
|
|
+ if (("益善缘".equals(cloudHostProper.getCompanyName()))) {
|
|
|
+
|
|
|
+ FsHfpayConfig fsPayConfig2 = fsHfpayConfigMapper.selectByAppId("wx0d1a3dd485268521");
|
|
|
+ huifuId = fsPayConfig2.getHuifuId();
|
|
|
+ }else {
|
|
|
+ huifuId=fsPayConfig.getHuifuId();
|
|
|
+ }
|
|
|
+ }
|
|
|
V2TradePaymentScanpayRefundRequest request = new V2TradePaymentScanpayRefundRequest();
|
|
|
request.setOrdAmt(payment.getPayMoney().toString());
|
|
|
+ request.setHuifuId(huifuId);
|
|
|
request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
|
|
|
request.setReqSeqId("refund-" + payment.getPayCode());
|
|
|
Map<String, Object> extendInfoMap = new HashMap<>();
|