Commit f68d32ec by huluobin

# 更新

parent a31a2dfb
......@@ -45,8 +45,8 @@ public class Application {
new JobScheduler(createRegistryCenter(),
createJobConfigurationNeNormal()).init();
new JobScheduler(createRegistryCenter(),
createJobConfigurationWeek()).init();
// new JobScheduler(createRegistryCenter(),
// createJobConfigurationWeek()).init();
}
......
......@@ -17,7 +17,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
......@@ -52,7 +51,8 @@ public class QueueConsumerJob implements SimpleJob {
List<DcBaseQueue> dcBaseQueueList = dcBaseQueueMapper.selectByExample(DcBaseQueueExample.newAndCreateCriteria()
.andConsumeDateIsNull()
.example());
.example()
.limit(1000));
dcBaseQueueList.forEach(dcBaseQueue -> {
BaseQueueMessage baseQueueMessage = JSON.parseObject(dcBaseQueue.getMessage(), BaseQueueMessage.class);
......@@ -63,13 +63,12 @@ public class QueueConsumerJob implements SimpleJob {
.example());
try {
autoTurnoverJob.autoTurnoverFromStock(DateTimeFormatter.ofPattern(CommonConstant.DATE_FORMAT).format(LocalDate.now()), dcBaseStock);
dcBaseQueueMapper.deleteByPrimaryKey(dcBaseQueue.getId());
} catch (Exception e) {
dcBaseQueue.setErrorMessage(e.getMessage());
dcBaseQueue.setErrorStackTrace(e.getStackTrace().toString());
} finally {
log.info("消费一条数据 message:{}", dcBaseQueue.getMessage());
dcBaseQueue.setConsumeDate(LocalDateTime.now());
dcBaseQueueMapper.updateByPrimaryKey(dcBaseQueue);
}
});
......
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