|
@@ -60,6 +60,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
@@ -224,6 +225,7 @@ public class JdApiServiceImpl implements JdApiService {
|
|
|
* @author hj
|
|
|
* @date 2023/12/13 22:30
|
|
|
*/
|
|
|
+ @PostConstruct
|
|
|
public void startJdOrder(){
|
|
|
JdClient jdClient = jdClientFactory.getJdClient();
|
|
|
while (true){
|
|
@@ -474,8 +476,8 @@ public class JdApiServiceImpl implements JdApiService {
|
|
|
Date startTime = jdInfoVo.getInitQueryDate();
|
|
|
Date endTime = new Date();
|
|
|
//根据下单时间获取数据库里最后一个订单
|
|
|
- JdOrder lastJdOrder = jdOrderService.getOne(q -> q.isNotNull(JdOrder::getCreatedDate).orderByDesc(JdOrder::getCreatedDate));
|
|
|
- if (ObjectUtil.isNotEmpty(lastJdOrder)) {
|
|
|
+ JdOrder lastJdOrder = jdOrderService.getLastJdOrder();
|
|
|
+ if (ObjectUtil.isNotNull(lastJdOrder)) {
|
|
|
//将最后一个下单时间减1个小时设置为开始时间
|
|
|
startTime = DateUtil.offsetHour(lastJdOrder.getCreatedDate(), -1);
|
|
|
}
|