1
This commit is contained in:
+22
-6
@@ -97,7 +97,7 @@ public class InstructionServiceImpl implements IInstructionService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> execute(String command, boolean forceGenerate, boolean isFromConsole, String wecomUserId) {
|
public List<String> execute(String command, boolean forceGenerate, boolean isFromConsole, String wecomUserId) {
|
||||||
// 存储接收的消息到Redis队列ALTER TABLE jd_order ADD COLUMN waybill_no VARCHAR(128) DEFAULT NULL COMMENT '物流运单号(手工填写或扫描回写)' AFTER logistics_link;
|
// 存储接收的消息到Redis队列
|
||||||
|
|
||||||
storeMessageToRedis("instruction:request", command);
|
storeMessageToRedis("instruction:request", command);
|
||||||
|
|
||||||
@@ -1582,8 +1582,10 @@ public class InstructionServiceImpl implements IInstructionService {
|
|||||||
return warn;
|
return warn;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订单号重复校验(控制台入口跳过此校验,允许管理员更新单号)
|
boolean placeholderJdOrderId = isPlaceholderJdOrderId(order);
|
||||||
if (!isFromConsole && !isEmpty(order.getOrderId())) {
|
|
||||||
|
// 订单号重复校验(控制台入口跳过;填物流单号时京东单号「1」允许重复)
|
||||||
|
if (!isFromConsole && !isEmpty(order.getOrderId()) && !placeholderJdOrderId) {
|
||||||
JDOrder existingByOrderId = jdOrderService.selectJDOrderByOrderId(order.getOrderId());
|
JDOrder existingByOrderId = jdOrderService.selectJDOrderByOrderId(order.getOrderId());
|
||||||
if (existingByOrderId != null) {
|
if (existingByOrderId != null) {
|
||||||
// 如果是更新同一条记录(remark相同),则不提示重复
|
// 如果是更新同一条记录(remark相同),则不提示重复
|
||||||
@@ -1645,8 +1647,8 @@ public class InstructionServiceImpl implements IInstructionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证1:如果查询不到对应订单,提示用户(控制台入口跳过此校验)
|
// 验证1:如果查询不到对应订单,提示用户(控制台入口跳过;占位京东单号「1」跳过)
|
||||||
if (!isFromConsole && (isEmpty(order.getOrderId()) || orderRow == null)) {
|
if (!isFromConsole && !placeholderJdOrderId && (isEmpty(order.getOrderId()) || orderRow == null)) {
|
||||||
String warn = "[炸弹] [炸弹] [炸弹] 录单警告!!! \n查询不到对应订单(使用红包 或者 转链),请五分钟后再试,或重新下单";
|
String warn = "[炸弹] [炸弹] [炸弹] 录单警告!!! \n查询不到对应订单(使用红包 或者 转链),请五分钟后再试,或重新下单";
|
||||||
return warn;
|
return warn;
|
||||||
}
|
}
|
||||||
@@ -1668,7 +1670,8 @@ public class InstructionServiceImpl implements IInstructionService {
|
|||||||
JDOrder exists = null;
|
JDOrder exists = null;
|
||||||
|
|
||||||
// 如果订单号不为空,优先根据订单号查找已存在的订单(用于刷新数据)
|
// 如果订单号不为空,优先根据订单号查找已存在的订单(用于刷新数据)
|
||||||
if (!isEmpty(order.getOrderId())) {
|
// 占位「1」会有多条,不能按订单号更新,否则会覆盖第一单
|
||||||
|
if (!isEmpty(order.getOrderId()) && !placeholderJdOrderId) {
|
||||||
exists = jdOrderService.selectJDOrderByOrderId(order.getOrderId());
|
exists = jdOrderService.selectJDOrderByOrderId(order.getOrderId());
|
||||||
if (exists != null) {
|
if (exists != null) {
|
||||||
// 根据订单号找到已存在的订单,更新该订单(刷新数据)
|
// 根据订单号找到已存在的订单,更新该订单(刷新数据)
|
||||||
@@ -1770,6 +1773,19 @@ public class InstructionServiceImpl implements IInstructionService {
|
|||||||
return s == null || s.isEmpty();
|
return s == null || s.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无物流链接、只填物流单号时,京东单号「1」为占位:允许重复,且不按该单号更新已有订单。
|
||||||
|
*/
|
||||||
|
private boolean isPlaceholderJdOrderId(JDOrder order) {
|
||||||
|
if (order == null || isEmpty(order.getOrderId()) || isEmpty(order.getWaybillNo())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!isEmpty(order.getLogisticsLink())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return "1".equals(order.getOrderId().trim());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化订单为完整表单格式
|
* 格式化订单为完整表单格式
|
||||||
* @param order 订单对象
|
* @param order 订单对象
|
||||||
|
|||||||
Reference in New Issue
Block a user