1
This commit is contained in:
@@ -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,获取京粉实际价格
|
||||
|
||||
Reference in New Issue
Block a user