修改 GPS
parent
dc372595c0
commit
55efc16afe
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.core.thread.ThreadPool;
|
||||
import com.njzscloud.common.core.tuple.Tuple3;
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
|
|
@ -30,10 +31,8 @@ import java.time.format.DateTimeFormatter;
|
|||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -43,7 +42,15 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
@Service
|
||||
public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMapper, TruckLocationTrackEntity> implements IService<TruckLocationTrackEntity> {
|
||||
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 5, 0, TimeUnit.SECONDS, new ArrayBlockingQueue<>(1));
|
||||
ThreadPoolExecutor threadPoolExecutor = ThreadPool.createThreadPool(
|
||||
"GPS 数据",
|
||||
10,
|
||||
200,
|
||||
60,
|
||||
1,
|
||||
1,
|
||||
new ThreadPoolExecutor.CallerRunsPolicy()
|
||||
);
|
||||
HashMap<String, List<SseEmitter>> emitters = new HashMap<>();
|
||||
ReentrantLock lock = new ReentrantLock();
|
||||
List<Tuple3<String, String, String>> realtimeDataListener = new LinkedList<>();
|
||||
|
|
@ -531,7 +538,7 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
realtimeDataListenerLock.unlock();
|
||||
}
|
||||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
/* CompletableFuture.runAsync(() -> {
|
||||
while (true) {
|
||||
ThreadUtil.sleep(3000);
|
||||
realtimeDataListenerLock.lock();
|
||||
|
|
@ -556,8 +563,7 @@ public class TruckLocationTrackService extends ServiceImpl<TruckLocationTrackMap
|
|||
);
|
||||
}
|
||||
}
|
||||
}, threadPoolExecutor);
|
||||
|
||||
}, threadPoolExecutor); */
|
||||
|
||||
/* CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
.setCheckerId(SecurityUtil.currentUserId())
|
||||
);
|
||||
|
||||
truckLeaving(new TruckLeavingOrderParam().setOrderId(orderId), 0);
|
||||
// truckLeaving(new TruckLeavingOrderParam().setOrderId(orderId), 0);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
|
|||
Loading…
Reference in New Issue