mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update订单逻辑改造工厂模式
This commit is contained in:
@@ -47,6 +47,7 @@ public class PayController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IMemberBasicInfoService memberBasicInfoService;
|
||||
|
||||
/**
|
||||
* 充值余额支付/微信余额充值
|
||||
* 提供给小程序使用
|
||||
@@ -128,7 +129,7 @@ public class PayController extends BaseController {
|
||||
String appId = request.getHeader("appId");
|
||||
dto.setWechatAppId(appId);
|
||||
map = orderService.payOrderV2(dto);
|
||||
map = orderService.payOrder(dto);
|
||||
// map = orderService.payOrder(dto);
|
||||
}
|
||||
response = new RestApiResponse<>(map);
|
||||
} catch (BusinessException e) {
|
||||
|
||||
@@ -141,6 +141,22 @@ public class OrderService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public String generateOrderV2(GenerateOrderDTO dto) throws ParseException {
|
||||
// 新逻辑
|
||||
String delayMode = pileMerchantInfoService.getDelayModeByWechatAppId(dto.getAppId());
|
||||
AbstractOrderLogic orderLogic = OrderLogicFactory.getOrderLogic(delayMode);
|
||||
OrderBasicInfo orderBasicInfo = orderLogic.generateOrder(dto);
|
||||
if (orderBasicInfo != null) {
|
||||
return orderBasicInfo.getOrderCode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单支付
|
||||
* @param dto
|
||||
|
||||
Reference in New Issue
Block a user