|
|
|
@ -714,7 +714,7 @@ public class JobMainTask { |
|
|
|
return rectangles.toString(); |
|
|
|
} |
|
|
|
|
|
|
|
synchronized private void addPointRecord(PatrolTaskExecRecord taskExecRecord, |
|
|
|
synchronized private PatrolTaskPointExecRecord addPointRecord(PatrolTaskExecRecord taskExecRecord, |
|
|
|
PatrolTaskInfo taskInfo, |
|
|
|
PatrolPresetPosSlim presetPos, |
|
|
|
StringBuffer fileTypes, |
|
|
|
@ -747,12 +747,13 @@ public class JobMainTask { |
|
|
|
log.info(Color.RED + "ADD_POINT_2_RECORD crud add taskPatrolId: {}, deviceId: {}" + Color.END, |
|
|
|
taskExecRecord.getOldTaskPatrolId(), deviceId); |
|
|
|
//if(!testMode) |
|
|
|
{ |
|
|
|
String patrolId = taskExecRecord.getTaskPatrolId(); |
|
|
|
String[] ids = patrolId.split(StringUtils.UNDERLINE); |
|
|
|
String taskPatrolIdRemote = ids[1] + "_" + ids[2]; |
|
|
|
callRemoteSendMsgCtrlMode(taskPatrolIdRemote, taskExecRecord.getTotalAlgorithmNumber(), pointExecRecord);/*上报巡视结果*/ |
|
|
|
} |
|
|
|
// { |
|
|
|
// String patrolId = taskExecRecord.getTaskPatrolId(); |
|
|
|
// String[] ids = patrolId.split(StringUtils.UNDERLINE); |
|
|
|
// String taskPatrolIdRemote = ids[1] + "_" + ids[2]; |
|
|
|
// callRemoteSendMsgCtrlMode(taskPatrolIdRemote, taskExecRecord.getTotalAlgorithmNumber(), pointExecRecord);/*上报巡视结果*/ |
|
|
|
// } |
|
|
|
return pointExecRecord; |
|
|
|
} |
|
|
|
|
|
|
|
private void callRemoteSendMsgRunMode(final String taskCode, final String taskName, final String taskPatrolId, final String taskProgress, final String state) { |
|
|
|
@ -822,7 +823,10 @@ public class JobMainTask { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
synchronized private int addCursorNumber(String taskPatrolId, int infoListSize) { |
|
|
|
synchronized private int addCursorNumber(String taskPatrolId, |
|
|
|
int infoListSize, |
|
|
|
PatrolTaskPointExecRecord pointExecRecord, |
|
|
|
int totalAlgorithNumber) { |
|
|
|
PatrolTaskExecRecord taskExecRecord = taskExecClient.selectPatrolTaskExecRecordByTaskPatrolId(taskPatrolId); |
|
|
|
|
|
|
|
int total = taskExecRecord.getTotalNumber(); |
|
|
|
@ -840,11 +844,12 @@ public class JobMainTask { |
|
|
|
taskExecRecord.setCursorNumber(cursor); |
|
|
|
//if (bOk) { |
|
|
|
success++; |
|
|
|
log.info("EXECUTE_POINT_SUCCESS taskPatrolId: {}, cursor: {}, success: {}, total: {}", |
|
|
|
log.info("EXECUTE_POINT_SUCCESS taskPatrolId: {}, cursor: {}, success: {}, total: {}, totalAlgorithNumber: {}", |
|
|
|
taskExecRecord.getOldTaskPatrolId(), |
|
|
|
cursor, |
|
|
|
success, |
|
|
|
total); |
|
|
|
total, |
|
|
|
totalAlgorithNumber); |
|
|
|
taskExecRecord.setFinishNumber(success); |
|
|
|
String taskProgress = decimalFormatNum(success, total);// task_progress=success/total -> patrol_task_exec_record |
|
|
|
taskExecRecord.setTaskProgress(taskProgress); |
|
|
|
@ -864,6 +869,19 @@ public class JobMainTask { |
|
|
|
totalProgress, |
|
|
|
TaskStatus.RUNNING.getCode()/*运行中百分比上报*/ |
|
|
|
); |
|
|
|
|
|
|
|
try { |
|
|
|
Thread.sleep(1000); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("error", e); |
|
|
|
} |
|
|
|
|
|
|
|
{ |
|
|
|
String patrolId = taskExecRecord.getTaskPatrolId(); |
|
|
|
String[] ids = patrolId.split(StringUtils.UNDERLINE); |
|
|
|
String taskPatrolIdRemote = ids[1] + "_" + ids[2]; |
|
|
|
callRemoteSendMsgCtrlMode(taskPatrolIdRemote, totalAlgorithNumber, pointExecRecord);/*上报巡视结果*/ |
|
|
|
} |
|
|
|
// } |
|
|
|
// else { |
|
|
|
// log.info("execute point fail, cursor: {}, success: {}, total: {}", cursor, success, total); |
|
|
|
@ -956,8 +974,9 @@ public class JobMainTask { |
|
|
|
StringBuffer filePaths) { |
|
|
|
|
|
|
|
//log.info(Color.CYAN + "recordPersistTrace bOk: {}" + Color.END, bOk); |
|
|
|
PatrolTaskPointExecRecord patrolTaskPointExecRecord = null; |
|
|
|
try { |
|
|
|
addPointRecord(taskExecRecord, taskInfo, presetPos, fileTypes, filePaths); |
|
|
|
patrolTaskPointExecRecord = addPointRecord(taskExecRecord, taskInfo, presetPos, fileTypes, filePaths); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("error", e); |
|
|
|
} |
|
|
|
@ -966,7 +985,7 @@ public class JobMainTask { |
|
|
|
log.info(Color.CYAN + "addCursorNumberStart" + Color.END); |
|
|
|
int cursorNumber = 0; |
|
|
|
try { |
|
|
|
cursorNumber = addCursorNumber(taskExecRecord.getTaskPatrolId(), infoListSize); |
|
|
|
cursorNumber = addCursorNumber(taskExecRecord.getTaskPatrolId(), infoListSize, patrolTaskPointExecRecord, taskExecRecord.getTotalAlgorithmNumber()); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("error", e); |
|
|
|
} |
|
|
|
@ -2091,9 +2110,9 @@ public class JobMainTask { |
|
|
|
continue; |
|
|
|
} |
|
|
|
String isEnable = patrolTasks.get(0).getIsEnable(); |
|
|
|
log.info("---execEveryDayTask isEnable: {}, taskCode: {}", isEnable, taskCode); |
|
|
|
log.debug("---execEveryDayTask isEnable: {}, taskCode: {}", isEnable, taskCode); |
|
|
|
if (isTaskSlotEmpty(taskCode) && "0".equals(isEnable)) { |
|
|
|
log.info(Color.YELLOW + "[JOB] TASK_CODE: {}" + Color.END, taskCode); |
|
|
|
log.debug(Color.YELLOW + "[JOB] TASK_CODE: {}" + Color.END, taskCode); |
|
|
|
// long currentTime = System.currentTimeMillis(); |
|
|
|
// long currentDays = TimeUnit.MILLISECONDS.toDays(currentTime); |
|
|
|
// long currentMinutes = TimeUnit.MILLISECONDS.toMinutes(currentTime); |
|
|
|
|