Commit a31a2dfb by huluobin

# 更新

parent c3aba19e
......@@ -18,7 +18,6 @@ public class AmazonAdGenerateReportIdJobTest {
@Test
public void executeJob() {
AmazonAdGenerateReportIdJob amazonAdGenerateReportIdJob = new AmazonAdGenerateReportIdJob();
amazonAdGenerateReportIdJob.execute(new ShardingContext(new ShardingContexts("x", "base-amazon-ad-product-generate", 1, null, new HashMap<>()), 0));
}
......
......@@ -13,7 +13,6 @@ import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.apache.ibatis.session.SqlSession;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
......@@ -39,7 +38,8 @@ public class ReplaceLogisticJob implements SimpleJob {
List<DcAutoReplaceLogisticsTask> dcAutoReplaceLogisticsTaskList = dcAutoReplaceLogisticsTaskMapper.selectByExample(DcAutoReplaceLogisticsTaskExample.newAndCreateCriteria()
.andStatusEqualTo(0)
.example());
.example()
.limit(1000));
dcAutoReplaceLogisticsTaskList.forEach(dcAutoReplaceLogisticsTask -> {
try {
......@@ -53,11 +53,12 @@ public class ReplaceLogisticJob implements SimpleJob {
autoTurnoverJob.autoTurnoverFromStock(DateTimeFormatter.ofPattern(CommonConstant.DATE_FORMAT).format(LocalDate.now()), dcBaseStock);
dcAutoReplaceLogisticsTask.setStatus(1);
dcAutoReplaceLogisticsTaskMapper.deleteByPrimaryKey(dcAutoReplaceLogisticsTask.getId());
} catch (Exception ex) {
dcAutoReplaceLogisticsTask.setStatus(2);
} finally {
dcAutoReplaceLogisticsTask.setUpdateDate(LocalDateTime.now());
dcAutoReplaceLogisticsTaskMapper.updateByPrimaryKeySelective(dcAutoReplaceLogisticsTask);
// dcAutoReplaceLogisticsTask.setUpdateDate(LocalDateTime.now());
// dcAutoReplaceLogisticsTaskMapper.updateByPrimaryKeySelective(dcAutoReplaceLogisticsTask);
logisticsTaskThreadLocal.remove();
}
});
......
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