录单
This commit is contained in:
@@ -37,4 +37,7 @@ public interface JDOrderRepository extends JpaRepository<JDOrder, Long> {
|
||||
List<JDOrder> findByDistributionMark(String distributionMark);
|
||||
|
||||
List<JDOrder> findByOrderTimeBetween(Date startTime, Date endTime);
|
||||
|
||||
// 并且按日期降序排序
|
||||
List<JDOrder> findByAddressOrderByOrderTimeDesc(String address);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
@@ -2198,7 +2197,40 @@ public class JDUtil {
|
||||
return;
|
||||
}
|
||||
if (Util.isAnyEmpty(jdOrder.getOrderId(), jdOrder.getBuyer(), jdOrder.getOrderTime(), jdOrder.getPaymentAmount(), jdOrder.getRebateAmount(), jdOrder.getAddress(), jdOrder.getLogisticsLink(), jdOrder.getModelNumber(), jdOrder.getLink(), jdOrder.getOrderId(), jdOrder.getBuyer())) {
|
||||
return;
|
||||
// 警告缺少的字段getOrderId
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (Util.isEmpty(jdOrder.getOrderId())) {
|
||||
sb.append(" 单号");
|
||||
}
|
||||
if (Util.isEmpty(jdOrder.getBuyer())) {
|
||||
sb.append(" 下单人");
|
||||
}
|
||||
if (Util.isEmpty(jdOrder.getPaymentAmount())) {
|
||||
sb.append(" 下单价格");
|
||||
}
|
||||
if (Util.isEmpty(jdOrder.getRebateAmount())) {
|
||||
sb.append(" 后返金额");
|
||||
}
|
||||
if (Util.isEmpty(jdOrder.getLogisticsLink())) {
|
||||
sb.append(" 物流链接");
|
||||
}
|
||||
if (Util.isEmpty(jdOrder.getAddress())) {
|
||||
sb.append(" 收货地址");
|
||||
}
|
||||
if (Util.isEmpty(jdOrder.getModelNumber())) {
|
||||
sb.append(" 型号");
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
wxUtil.sendTextMessage(fromWxid, "[Broken] [Broken] [Broken] 录单警告!!! 缺少 " + sb, 1, fromWxid, false);
|
||||
}
|
||||
}
|
||||
List<JDOrder> byAddress = jdOrderRepository.findByAddressOrderByOrderTimeDesc(jdOrder.getAddress());
|
||||
if (!byAddress.isEmpty()) {
|
||||
int count = byAddress.size();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(DateUtil.dateToStr(byAddress.get(0).getOrderTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
wxUtil.sendTextMessage(fromWxid, "[Broken] [Broken] [Broken] 录单警告!!! 收货地址重复,请确认 !!! \n 此地址共" + count + "个订单,最近的订单时间:" + sb, 1, fromWxid, false);
|
||||
|
||||
}
|
||||
JDOrder byRemark = jdOrderRepository.findByRemark(jdOrder.getRemark());
|
||||
String info;
|
||||
|
||||
Reference in New Issue
Block a user