mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 订单逻辑改造工厂模式
This commit is contained in:
@@ -110,7 +110,9 @@ public interface IPileMerchantInfoService {
|
||||
|
||||
String getDelayModeByWechatAppId(String wechatAppId);
|
||||
|
||||
/**
|
||||
String getDelayModeByMerchantId(String merchantId);
|
||||
|
||||
/**
|
||||
* 通过merchantId获取一级运营商信息
|
||||
*/
|
||||
PileMerchantInfo getFirstLevelMerchantByMerchantId(String merchantId);
|
||||
|
||||
@@ -38,6 +38,8 @@ import com.jsowell.pile.domain.*;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.mapper.OrderBasicInfoMapper;
|
||||
import com.jsowell.pile.service.*;
|
||||
import com.jsowell.pile.service.orderlogic.AbstractOrderLogic;
|
||||
import com.jsowell.pile.service.orderlogic.OrderLogicFactory;
|
||||
import com.jsowell.pile.transaction.dto.ClearingBillTransactionDTO;
|
||||
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
|
||||
import com.jsowell.pile.transaction.service.TransactionService;
|
||||
@@ -445,7 +447,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
.flatUsedElectricity(Constants.ZERO)
|
||||
.valleyUsedElectricity(Constants.ZERO)
|
||||
.build();
|
||||
settleOrder(data, orderInfo);
|
||||
// settleOrder(data, orderInfo);
|
||||
|
||||
// 新逻辑
|
||||
String mode = pileMerchantInfoService.getDelayModeByMerchantId(orderInfo.getMerchantId());
|
||||
AbstractOrderLogic orderLogic = OrderLogicFactory.getOrderLogic(mode);
|
||||
orderLogic.settleOrder(data, orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -422,6 +422,20 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
||||
return merchant.getDelayMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过运营商id查询一级运营商配置的delayMode
|
||||
* @param merchantId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getDelayModeByMerchantId(String merchantId) {
|
||||
PileMerchantInfo merchant = getFirstLevelMerchantByMerchantId(merchantId);
|
||||
if (merchant == null) {
|
||||
return null;
|
||||
}
|
||||
return merchant.getAppId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PileMerchantInfo getFirstLevelMerchantByMerchantId(String merchantId) {
|
||||
if (StringUtils.isBlank(merchantId)) {
|
||||
|
||||
Reference in New Issue
Block a user