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