This commit is contained in:
Leo
2025-11-14 23:43:41 +08:00
parent 2e59f49677
commit 0880628c93

View File

@@ -1309,23 +1309,12 @@ public class InstructionServiceImpl implements IInstructionService {
}
}
// 地址重复检查
// 地址重复提示(不阻断写入,与 JDUtil 提示一致)
List<JDOrder> byAddress = jdOrderService.selectJDOrderListByAddress(order.getAddress());
if (byAddress != null && !byAddress.isEmpty()) {
// 如果强制生成,跳过地址重复检查
if (!forceGenerate) {
// 返回特殊错误码,前端会识别并弹出验证码
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
int count = byAddress.size();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < Math.min(count, 3); i++) {
if (i > 0) sb.append("\n");
sb.append(sdf.format(byAddress.get(i).getOrderTime()));
}
// 使用特殊错误码标识地址重复
return "ERROR_CODE:ADDRESS_DUPLICATE\n收货地址重复此地址共" + count + "个订单,最近的订单时间:" + sb.toString();
}
// forceGenerate为true时跳过地址重复检查继续执行
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String latest = sdf.format(byAddress.get(0).getOrderTime());
// 仅提示,不阻断写入
}
// 根据订单号查询order_rows获取京粉实际价格