You've already forked FrameTour-BE
fix(printer): 修复支付价格比较逻辑和数据返回问题
- 将支付价格比较方式从 equals 修改为 compareTo 方法以确保精度正确性 - 调整 orderId 返回逻辑的位置,确保在所有情况下都能正确返回
This commit is contained in:
@@ -692,7 +692,7 @@ public class PrinterServiceImpl implements PrinterService {
|
|||||||
throw new BaseException("订单添加失败");
|
throw new BaseException("订单添加失败");
|
||||||
}
|
}
|
||||||
Map<String, Object> data = new HashMap<>();
|
Map<String, Object> data = new HashMap<>();
|
||||||
if (order.getPayPrice().equals(BigDecimal.ZERO)) {
|
if (order.getPayPrice().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
orderBiz.paidOrder(order.getId());
|
orderBiz.paidOrder(order.getId());
|
||||||
data.put("needPay", false);
|
data.put("needPay", false);
|
||||||
} else {
|
} else {
|
||||||
@@ -708,8 +708,8 @@ public class PrinterServiceImpl implements PrinterService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BaseException(e);
|
throw new BaseException(e);
|
||||||
}
|
}
|
||||||
data.put("orderId", orderId);
|
|
||||||
}
|
}
|
||||||
|
data.put("orderId", orderId);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user