diff --git a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/InstructionServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/InstructionServiceImpl.java
index 23ed456..c259849 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/InstructionServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/jarvis/service/impl/InstructionServiceImpl.java
@@ -1157,9 +1157,10 @@ private String handleTF(String input) {
}
// 根据订单号查询order_rows,获取京粉实际价格
+ OrderRows orderRow = null;
if (!isEmpty(order.getOrderId())) {
try {
- OrderRows orderRow = orderRowsService.selectOrderRowsByOrderId(order.getOrderId());
+ orderRow = orderRowsService.selectOrderRowsByOrderId(order.getOrderId());
if (orderRow != null && orderRow.getEstimateCosPrice() != null) {
order.setJingfenActualPrice(orderRow.getEstimateCosPrice());
}
@@ -1168,6 +1169,23 @@ private String handleTF(String input) {
}
}
+ // 验证1:如果查询不到对应订单,提示用户
+ if (isEmpty(order.getOrderId()) || orderRow == null) {
+ String warn = "[炸弹] [炸弹] [炸弹] 录单警告!!! \n查询不到对应订单(使用红包 或者 转链),请五分钟后再试,或重新下单";
+ return warn;
+ }
+
+ // 验证2:如果京粉实际价格不为空,检查与付款金额的差值
+ if (order.getJingfenActualPrice() != null && order.getPaymentAmount() != null) {
+ double diff = Math.abs(order.getPaymentAmount() - order.getJingfenActualPrice());
+ if (Math.abs(diff - 100.0) < 0.01) { // 允许浮点数误差
+ String warn = "[炸弹] [炸弹] [炸弹] 录单警告!!! \n付款金额和实际金额相差100,请联系管理员录单\n" +
+ "付款金额:" + order.getPaymentAmount() + "\n" +
+ "京粉实际价格:" + order.getJingfenActualPrice();
+ return warn;
+ }
+ }
+
// 按 remark 判断新增/更新
JDOrder exists = jdOrderService.selectJDOrderByRemark(order.getRemark());
if (exists != null) {
diff --git a/ruoyi-system/src/main/resources/mapper/jarvis/OrderRowsMapper.xml b/ruoyi-system/src/main/resources/mapper/jarvis/OrderRowsMapper.xml
index edd4100..aa0e2bf 100644
--- a/ruoyi-system/src/main/resources/mapper/jarvis/OrderRowsMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/jarvis/OrderRowsMapper.xml
@@ -124,7 +124,7 @@
and order_time >= #{params.beginTime}
and order_time <= #{params.endTime}
-1
+
order by ${params.orderBy} ${params.isAsc}