1
This commit is contained in:
@@ -30,6 +30,16 @@ public interface JDOrderMapper {
|
||||
JDOrder selectJDOrderByRemark(String remark);
|
||||
|
||||
List<JDOrder> selectJDOrderListByAddress(String address);
|
||||
|
||||
/**
|
||||
* 根据订单号查询订单
|
||||
*/
|
||||
JDOrder selectJDOrderByOrderId(String orderId);
|
||||
|
||||
/**
|
||||
* 根据物流链接查询订单
|
||||
*/
|
||||
JDOrder selectJDOrderByLogisticsLink(String logisticsLink);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,12 @@ public interface IJDOrderService {
|
||||
|
||||
/** 按地址倒序查询全部 */
|
||||
java.util.List<JDOrder> selectJDOrderListByAddress(String address);
|
||||
|
||||
/** 根据订单号查询订单 */
|
||||
JDOrder selectJDOrderByOrderId(String orderId);
|
||||
|
||||
/** 根据物流链接查询订单 */
|
||||
JDOrder selectJDOrderByLogisticsLink(String logisticsLink);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -961,6 +961,36 @@ private String handleTF(String input) {
|
||||
return warn;
|
||||
}
|
||||
|
||||
// 订单号重复校验
|
||||
if (!isEmpty(order.getOrderId())) {
|
||||
JDOrder existingByOrderId = jdOrderService.selectJDOrderByOrderId(order.getOrderId());
|
||||
if (existingByOrderId != null) {
|
||||
// 如果是更新同一条记录(remark相同),则不提示重复
|
||||
if (!order.getRemark().equals(existingByOrderId.getRemark())) {
|
||||
String warn = "[炸弹] [炸弹] [炸弹] 录单警告!!! \n订单号重复!\n" +
|
||||
"订单号:" + order.getOrderId() + "\n" +
|
||||
"已存在的订单:" + existingByOrderId.getRemark() + "\n" +
|
||||
"下单时间:" + new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(existingByOrderId.getOrderTime());
|
||||
return warn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 物流链接重复校验
|
||||
if (!isEmpty(order.getLogisticsLink())) {
|
||||
JDOrder existingByLogistics = jdOrderService.selectJDOrderByLogisticsLink(order.getLogisticsLink());
|
||||
if (existingByLogistics != null) {
|
||||
// 如果是更新同一条记录(remark相同),则不提示重复
|
||||
if (!order.getRemark().equals(existingByLogistics.getRemark())) {
|
||||
String warn = "[炸弹] [炸弹] [炸弹] 录单警告!!! \n物流链接重复!\n" +
|
||||
"物流链接:" + order.getLogisticsLink() + "\n" +
|
||||
"已存在的订单:" + existingByLogistics.getRemark() + "\n" +
|
||||
"下单时间:" + new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(existingByLogistics.getOrderTime());
|
||||
return warn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 地址重复提示(不阻断写入,与 JDUtil 提示一致)
|
||||
List<JDOrder> byAddress = jdOrderService.selectJDOrderListByAddress(order.getAddress());
|
||||
if (byAddress != null && !byAddress.isEmpty()) {
|
||||
|
||||
@@ -48,6 +48,16 @@ public class JDOrderServiceImpl implements IJDOrderService {
|
||||
public List<JDOrder> selectJDOrderListByAddress(String address) {
|
||||
return jdOrderMapper.selectJDOrderListByAddress(address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JDOrder selectJDOrderByOrderId(String orderId) {
|
||||
return jdOrderMapper.selectJDOrderByOrderId(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JDOrder selectJDOrderByLogisticsLink(String logisticsLink) {
|
||||
return jdOrderMapper.selectJDOrderByLogisticsLink(logisticsLink);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -136,6 +136,20 @@
|
||||
order by order_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectJDOrderByOrderId" parameterType="string" resultMap="JDOrderResult">
|
||||
<include refid="selectJDOrderBase"/>
|
||||
where order_id = #{orderId}
|
||||
order by order_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectJDOrderByLogisticsLink" parameterType="string" resultMap="JDOrderResult">
|
||||
<include refid="selectJDOrderBase"/>
|
||||
where logistics_link = #{logisticsLink}
|
||||
order by order_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user