|
|
@ -46,7 +46,7 @@ public class MoveMaterialAuditBufferTaskService extends TaskBaseService {
|
|
|
|
* 同时开启任务处理数量
|
|
|
|
* 同时开启任务处理数量
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public int getCorePoolSiz() {
|
|
|
|
public int getCorePoolSiz() {
|
|
|
|
return 3;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -71,7 +71,7 @@ public class MoveMaterialAuditBufferTaskService extends TaskBaseService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Async("moveMaterialAuditBufferPool")
|
|
|
|
@Async("moveMaterialAuditBufferPool")
|
|
|
|
@Scheduled(fixedRate =3000)
|
|
|
|
@Scheduled(fixedRate =2000)
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void runTask() {
|
|
|
|
public void runTask() {
|
|
|
|
super.runTask();
|
|
|
|
super.runTask();
|
|
|
@ -84,7 +84,7 @@ public class MoveMaterialAuditBufferTaskService extends TaskBaseService {
|
|
|
|
public Object getTask() {
|
|
|
|
public Object getTask() {
|
|
|
|
long lastBufferId = 0;
|
|
|
|
long lastBufferId = 0;
|
|
|
|
int limit = 20;
|
|
|
|
int limit = 20;
|
|
|
|
log.info("start bufferToQueue");
|
|
|
|
log.info("start moveMaterialAuditBuffer");
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
// 判断queue是否满了
|
|
|
|
// 判断queue是否满了
|
|
|
|
int queueCnt = materialAuditStatusBufferService.count();
|
|
|
|
int queueCnt = materialAuditStatusBufferService.count();
|
|
|
@ -133,7 +133,7 @@ public class MoveMaterialAuditBufferTaskService extends TaskBaseService {
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
transactionManager.rollback(status);
|
|
|
|
transactionManager.rollback(status);
|
|
|
|
log.info("任务执行失败 数据回滚: ", e);
|
|
|
|
log.error("任务执行失败 数据回滚: moveMaterialAuditBuffer", e);
|
|
|
|
if (e.getMessage().contains("udx_material_id")) {
|
|
|
|
if (e.getMessage().contains("udx_material_id")) {
|
|
|
|
List<String> materialIdList = bufferList.stream().map(MaterialAuditStatusBuffer::getMaterialId).collect(Collectors.toList());
|
|
|
|
List<String> materialIdList = bufferList.stream().map(MaterialAuditStatusBuffer::getMaterialId).collect(Collectors.toList());
|
|
|
|
List<String> exitMaterialIds = materialAuditStatusQueueService.getByMaterialIdList(materialIdList);
|
|
|
|
List<String> exitMaterialIds = materialAuditStatusQueueService.getByMaterialIdList(materialIdList);
|
|
|
@ -143,7 +143,7 @@ public class MoveMaterialAuditBufferTaskService extends TaskBaseService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.info("end bufferToQueue");
|
|
|
|
log.info("end moveMaterialAuditBuffer");
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|