收银台参数问题优化,如果不匹配直接跳过。

This commit is contained in:
Chopper 2021-06-09 09:24:35 +08:00
parent da1863850a
commit b30a55eafa

View File

@ -145,6 +145,10 @@ public class CashierSupport {
public CashierParam cashierParam(PayParam payParam) {
for (CashierExecute paramInterface : cashierExecuteList) {
CashierParam cashierParam = paramInterface.getPaymentParams(payParam);
//如果为空则表示收银台参数初始化不匹配继续匹配下一条
if (cashierParam == null) {
continue;
}
//如果订单不需要付款则抛出异常直接返回
if (cashierParam.getPrice() <= 0) {
throw new ServiceException(ResultCode.PAY_UN_WANTED);