|
|
|
@ -42,8 +42,8 @@ public class LabelTransactionLogServiceImpl implements LabelTransactionLogServic |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> batchRetry(List<Map<String, Object>> retryList) { |
|
|
|
logger.info("批量手动重试开始,记录数: {}", retryList.size()); |
|
|
|
public Map<String, Object> batchRetry(List<Map<String, Object>> retryList, boolean isExceptionRetry) { |
|
|
|
logger.info("批量手动重试开始,记录数: {}, 是否异常重试: {}", retryList.size(), isExceptionRetry); |
|
|
|
|
|
|
|
int successCount = 0; |
|
|
|
int failureCount = 0; |
|
|
|
@ -59,18 +59,20 @@ public class LabelTransactionLogServiceImpl implements LabelTransactionLogServic |
|
|
|
|
|
|
|
try { |
|
|
|
// 1. 校验StockTransactionLog的传输状态 |
|
|
|
Map<String, Object> syncStatus = stockTransactionLogDao.getSyncStatus(site, buNo, transactionId); |
|
|
|
if (syncStatus != null) { |
|
|
|
String syncedFlag = syncStatus.get("syncedFlag") != null ? syncStatus.get("syncedFlag").toString() : ""; |
|
|
|
|
|
|
|
// 传输状态必须是"待传输"(即synced_flag不为Y) |
|
|
|
if ("Y".equalsIgnoreCase(syncedFlag)) { |
|
|
|
logger.warn("该记录已传输成功,不允许重试,transactionId: {}", transactionId); |
|
|
|
detail.put("status", "failure"); |
|
|
|
detail.put("message", "该记录已传输成功,不允许重试"); |
|
|
|
details.add(detail); |
|
|
|
failureCount++; |
|
|
|
continue; |
|
|
|
if (!isExceptionRetry) { |
|
|
|
Map<String, Object> syncStatus = stockTransactionLogDao.getSyncStatus(site, buNo, transactionId); |
|
|
|
if (syncStatus != null) { |
|
|
|
String syncedFlag = syncStatus.get("syncedFlag") != null ? syncStatus.get("syncedFlag").toString() : ""; |
|
|
|
|
|
|
|
// 传输状态必须是"待传输"(即synced_flag不为Y) |
|
|
|
if ("Y".equalsIgnoreCase(syncedFlag)) { |
|
|
|
logger.warn("该记录已传输成功,不允许重试,transactionId: {}", transactionId); |
|
|
|
detail.put("status", "failure"); |
|
|
|
detail.put("message", "该记录已传输成功,不允许重试"); |
|
|
|
details.add(detail); |
|
|
|
failureCount++; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|