mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 03:49:19 +08:00
fix: 移除批量发布任务中未使用的成败计数变量
This commit is contained in:
-15
@@ -70,18 +70,6 @@ public class PddGoodsPublishJobRunnerImpl implements PddGoodsPublishJobRunner {
|
|||||||
}
|
}
|
||||||
List<PddGoodsPublishJobItemPO> items = jobItemMapper.selectList(qw);
|
List<PddGoodsPublishJobItemPO> items = jobItemMapper.selectList(qw);
|
||||||
|
|
||||||
int success = job.getSuccessCount() == null ? 0 : job.getSuccessCount();
|
|
||||||
int fail = onlyFailed ? 0 : (job.getFailCount() == null ? 0 : job.getFailCount());
|
|
||||||
if (onlyFailed) {
|
|
||||||
// 重试失败项:先把失败数扣回,下面按结果重算
|
|
||||||
fail = 0;
|
|
||||||
success = (job.getTotalCount() == null ? 0 : job.getTotalCount())
|
|
||||||
- items.size();
|
|
||||||
if (success < 0) {
|
|
||||||
success = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PddGoodsPublishJobItemPO item : items) {
|
for (PddGoodsPublishJobItemPO item : items) {
|
||||||
item.setStatus(PddGoodsPublishJobItemPO.STATUS_RUNNING);
|
item.setStatus(PddGoodsPublishJobItemPO.STATUS_RUNNING);
|
||||||
item.setErrorMessage(null);
|
item.setErrorMessage(null);
|
||||||
@@ -90,7 +78,6 @@ public class PddGoodsPublishJobRunnerImpl implements PddGoodsPublishJobRunner {
|
|||||||
PddGoodsPublishDraftPO draft = draftMapper.selectById(item.getDraftId());
|
PddGoodsPublishDraftPO draft = draftMapper.selectById(item.getDraftId());
|
||||||
if (draft == null || !companyId.equals(draft.getCompanyId())) {
|
if (draft == null || !companyId.equals(draft.getCompanyId())) {
|
||||||
markItemFailed(item, "草稿不存在");
|
markItemFailed(item, "草稿不存在");
|
||||||
fail++;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
draft.setStatus(PddGoodsPublishDraftPO.STATUS_PUBLISHING);
|
draft.setStatus(PddGoodsPublishDraftPO.STATUS_PUBLISHING);
|
||||||
@@ -109,7 +96,6 @@ public class PddGoodsPublishJobRunnerImpl implements PddGoodsPublishJobRunner {
|
|||||||
item.setErrorMessage(null);
|
item.setErrorMessage(null);
|
||||||
jobItemMapper.updateById(item);
|
jobItemMapper.updateById(item);
|
||||||
// status / commitId / goodsId 由 publish(systemDraftId) 回写
|
// status / commitId / goodsId 由 publish(systemDraftId) 回写
|
||||||
success++;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String msg = e.getMessage() == null ? "发布失败" : e.getMessage();
|
String msg = e.getMessage() == null ? "发布失败" : e.getMessage();
|
||||||
if (msg.length() > 900) {
|
if (msg.length() > 900) {
|
||||||
@@ -119,7 +105,6 @@ public class PddGoodsPublishJobRunnerImpl implements PddGoodsPublishJobRunner {
|
|||||||
draft.setStatus(PddGoodsPublishDraftPO.STATUS_FAILED);
|
draft.setStatus(PddGoodsPublishDraftPO.STATUS_FAILED);
|
||||||
draft.setLastError(msg);
|
draft.setLastError(msg);
|
||||||
draftMapper.updateById(draft);
|
draftMapper.updateById(draft);
|
||||||
fail++;
|
|
||||||
log.warn("publish desk job item failed jobId={} draftId={}", jobId, item.getDraftId(), e);
|
log.warn("publish desk job item failed jobId={} draftId={}", jobId, item.getDraftId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user