Commit 80eaba86 authored by 韩桐桐's avatar 韩桐桐

添加作废listener日志

parent 7cbce420
...@@ -53,12 +53,17 @@ public class CancellationEventListener { ...@@ -53,12 +53,17 @@ public class CancellationEventListener {
@PostConstruct @PostConstruct
public void init() { public void init() {
ExecutorService executorService = Executors.newFixedThreadPool(threadNumber); ExecutorService executorService = Executors.newFixedThreadPool(threadNumber, r -> {
Thread t = new Thread(r);
t.setName("CancellationWorker-" + t.getId());
return t;
});
for (int i = 0; i < threadNumber; i++) { for (int i = 0; i < threadNumber; i++) {
executorService.execute(() -> { executorService.execute(() -> {
while (true) { while (true) {
try { try {
String record = queue.take(); String record = queue.take();
log.info("线程 {} 开始处理 record: {}", Thread.currentThread().getName(), record);
this.dealData(record); this.dealData(record);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
...@@ -70,6 +75,7 @@ public class CancellationEventListener { ...@@ -70,6 +75,7 @@ public class CancellationEventListener {
} }
private void dealData(String record) { private void dealData(String record) {
log.info("开始检查设备的引用:{}", record);
// 所有业务单据(除去作废、删除状态单据),有在引用设备的则不修改设备纳管状态 // 所有业务单据(除去作废、删除状态单据),有在引用设备的则不修改设备纳管状态
Boolean inUsed = commonService.checkEquipIsUsed(record); Boolean inUsed = commonService.checkEquipIsUsed(record);
// 无引用则进行修改纳管状态为未纳管 // 无引用则进行修改纳管状态为未纳管
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment