Commit bcd16871 by xiangkun.gu

Merge remote-tracking branch 'origin/applet/2022-02-11-暴露创建订单业务相关接口' into develop

parents 8e151c78 38fabf89
package cn.freemud.controller;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.entities.vo.PutDeadLetterVo;
import cn.freemud.service.impl.PayServiceImpl;
import cn.freemud.utils.ResponseUtil;
import com.freemud.application.sdk.api.log.ApiAnnotation;
import com.freemud.application.sdk.api.log.LogParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 暴露订单相关的业务接口,提供给applet项目
*/
@RestController
@RequestMapping("/exposure")
public class ExposureOrderController {
@Autowired
private PayServiceImpl payService;
/**
* 创建支付单,查询支付配置
*/
@ApiAnnotation(logMessage = "创建支付单,查询支付配置")
@GetMapping("/getPayConfig")
public BaseResponse<String> getPayConfig(@LogParams @RequestParam("partnerId") String partnerId, @RequestParam("appId") String appId) {
String payConfig = payService.getPayConfig(partnerId, appId);
return ResponseUtil.success(payConfig);
}
/**
* 创建支付单,查询超时时间
*/
@ApiAnnotation(logMessage = "创建支付单,查询超时时间")
@GetMapping("/getPayTimeout")
public BaseResponse<String> getPayTimeout(@LogParams @RequestParam("partnerId") String partnerId) {
String partnerPayOvertime = payService.getPartnerPayOvertime(partnerId);
return ResponseUtil.success(partnerPayOvertime);
}
/**
* 创建支付单,查询payCode
*/
@ApiAnnotation(logMessage = "创建支付单,查询payCode")
@GetMapping("/getPayCodeByChanel")
public BaseResponse<String> getPayCodeByChanel(@LogParams @RequestParam("appId") String appId,
@RequestParam("storeId") String storeId,
@RequestParam(value = "channel", required = false) String channel) {
String payCodeByCondition = payService.getPayCodeByCondition(appId, storeId, channel);
return ResponseUtil.success(payCodeByCondition);
}
/**
* 创建订单,死信队列
*/
@ApiAnnotation(logMessage = "创建订单,死信队列")
@PostMapping("/deadLetterQueue")
public BaseResponse deadLetterQueue(@LogParams @RequestBody PutDeadLetterVo putDeadLetterVo) {
payService.putDelMq(putDeadLetterVo.getPartnerId(), putDeadLetterVo.getStoreId(), putDeadLetterVo.getFmId(), putDeadLetterVo.getOrderId(), putDeadLetterVo.getPayChanelType());
return ResponseUtil.success();
}
}
package cn.freemud.entities.vo;
import lombok.Data;
@Data
public class PutDeadLetterVo {
private String partnerId;
private String storeId;
private String fmId;
private String orderId;
private Integer payChanelType;
}
...@@ -472,6 +472,10 @@ public class PayServiceImpl { ...@@ -472,6 +472,10 @@ public class PayServiceImpl {
return principalName; return principalName;
} }
public String getPayConfig(String partnerId, String appId) {
return this.getPaymentPrincipalName(partnerId, appId);
}
/** /**
* 电子风味卡支付 * 电子风味卡支付
...@@ -1140,6 +1144,14 @@ public class PayServiceImpl { ...@@ -1140,6 +1144,14 @@ public class PayServiceImpl {
return ""; return "";
} }
public String getPayCodeByCondition(String wxAppid, String storeId, String channel) {
if (channel != null) {
return this.getPayCodeByChanel(wxAppid, channel, storeId);
}
return this.getPayCodeByChanel(wxAppid, storeId);
}
/** /**
* 获取混合支付是否开启 * 获取混合支付是否开启
......
...@@ -2376,6 +2376,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2376,6 +2376,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (Objects.isNull(availableStocks)) { if (Objects.isNull(availableStocks)) {
return; return;
} }
// 商品服务 返回null 或者 qty=null 表示不限制库存
List<GetProductStockResponseDto.DataBean> result = availableStocks.getResult(); List<GetProductStockResponseDto.DataBean> result = availableStocks.getResult();
if (CollectionUtils.isEmpty(result) || Objects.isNull(result.get(0).getQty())) { if (CollectionUtils.isEmpty(result) || Objects.isNull(result.get(0).getQty())) {
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment