demand: 17track打印问题日志,移除漏组批次扫描定时任务
This commit is contained in:
parent
e6b88ade6b
commit
2f8b8fd30d
@ -951,34 +951,35 @@ public class EmisCommonController extends EmisBaseController
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/autoScanSiteBatch")
|
@GetMapping("/autoScanSiteBatch")
|
||||||
public AjaxResult autoScanSiteBatch(String lineCode) {
|
public AjaxResult autoScanSiteBatch(String lineCode) {
|
||||||
String statusKey = "autoScanSiteBatch_status";
|
return AjaxResult.success("定时任务已关闭");
|
||||||
log.info("autoScanSiteBatch start");
|
// String statusKey = "autoScanSiteBatch_status";
|
||||||
|
// log.info("autoScanSiteBatch start");
|
||||||
// 检查任务是否正在执行
|
//
|
||||||
String currentStatus = redissonService.getStr(statusKey);
|
// // 检查任务是否正在执行
|
||||||
if ("RUNNING".equals(currentStatus)) {
|
// String currentStatus = redissonService.getStr(statusKey);
|
||||||
log.warn("autoScanSiteBatch is already running, request rejected");
|
// if ("RUNNING".equals(currentStatus)) {
|
||||||
return AjaxResult.error("任务正在执行中,请稍后再试");
|
// log.warn("autoScanSiteBatch is already running, request rejected");
|
||||||
}
|
// return AjaxResult.error("任务正在执行中,请稍后再试");
|
||||||
|
// }
|
||||||
try {
|
//
|
||||||
// 设置任务状态为运行中,设置较长的过期时间(30分钟)
|
// try {
|
||||||
// 这样即使异步任务没有正确清除状态,也会在30分钟后自动过期
|
// // 设置任务状态为运行中,设置较长的过期时间(30分钟)
|
||||||
redissonService.setStr(statusKey, "RUNNING", 1800);
|
// // 这样即使异步任务没有正确清除状态,也会在30分钟后自动过期
|
||||||
|
// redissonService.setStr(statusKey, "RUNNING", 1800);
|
||||||
// 异步执行任务
|
//
|
||||||
emisTmsSiteBatchMissService.autoScanSiteBatch(lineCode);
|
// // 异步执行任务
|
||||||
log.info("autoScanSiteBatch async task started");
|
// emisTmsSiteBatchMissService.autoScanSiteBatch(lineCode);
|
||||||
|
// log.info("autoScanSiteBatch async task started");
|
||||||
return AjaxResult.success("异步任务已启动,请稍后查看执行结果");
|
//
|
||||||
|
// return AjaxResult.success("异步任务已启动,请稍后查看执行结果");
|
||||||
} catch (Exception ex) {
|
//
|
||||||
ex.printStackTrace();
|
// } catch (Exception ex) {
|
||||||
log.error("autoScanSiteBatch exception:" + ex.getMessage());
|
// ex.printStackTrace();
|
||||||
// 如果启动失败,清除状态
|
// log.error("autoScanSiteBatch exception:" + ex.getMessage());
|
||||||
redissonService.setStr(statusKey, "", 0);
|
// // 如果启动失败,清除状态
|
||||||
return AjaxResult.error("任务启动失败:" + ex.getMessage());
|
// redissonService.setStr(statusKey, "", 0);
|
||||||
}
|
// return AjaxResult.error("任务启动失败:" + ex.getMessage());
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -183,6 +183,9 @@ public class Q17trackHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("17track查询异常, transferBillCode: {}, comId: {}, phone: {}, rstStr: {}",
|
||||||
|
emisTmsTransferTrace != null ? emisTmsTransferTrace.getTransferBillCode() : null,
|
||||||
|
comId, phone, rstStr, e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user