4 Commits

14 changed files with 159 additions and 24 deletions
Unified View
  1. +3
    -0
      inspect-job/src/main/java/com/inspect/job/client/TaskExecClient.java
  2. +23
    -2
      inspect-job/src/main/java/com/inspect/job/domain/task/PatrolTask.java
  3. +7
    -1
      inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java
  4. +6
    -0
      inspect-main/inspect-main-task-exec/src/main/java/com/inspect/exec/controller/PatrolTaskExecController.java
  5. +2
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java
  6. +3
    -3
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  7. +36
    -9
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java
  8. +7
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/mapper/PatrolTaskInfoMapper.java
  9. +7
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/service/IPatrolTaskInfoService.java
  10. +16
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/service/impl/PatrolTaskInfoServiceImpl.java
  11. +40
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskInfoMapper.xml
  12. +1
    -1
      inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml
  13. +7
    -7
      inspect-metadata/src/main/java/com/inspect/metadata/patrolpointmnt/service/impl/BasedataPatrolPointServiceImpl.java
  14. +1
    -1
      inspect-metadata/src/main/resources/mapper/eqpbook/BasedataEqpBookMapper.xml

+ 3
- 0
inspect-job/src/main/java/com/inspect/job/client/TaskExecClient.java View File

@ -19,6 +19,9 @@ public interface TaskExecClient {
@PostMapping({"/exec/selectTaskList"}) @PostMapping({"/exec/selectTaskList"})
List<PatrolTask> selectTaskList(PatrolTask task); List<PatrolTask> selectTaskList(PatrolTask task);
@PostMapping({"/exec/selectPatrolTaskList"})
List<PatrolTask> selectPatrolTaskList(PatrolTask task);
@PostMapping({"/exec/selectTaskInfoList"}) @PostMapping({"/exec/selectTaskInfoList"})
List<PatrolTaskInfo> selectTaskInfoList(PatrolTaskInfo taskInfo); List<PatrolTaskInfo> selectTaskInfoList(PatrolTaskInfo taskInfo);


+ 23
- 2
inspect-job/src/main/java/com/inspect/job/domain/task/PatrolTask.java View File

@ -80,6 +80,8 @@ public class PatrolTask extends BaseEntity {
) )
private Date invalidEndTime; private Date invalidEndTime;
private String isEnable; private String isEnable;
private String isenable;
private String linkageState; private String linkageState;
private String devType; private String devType;
private String creator; private String creator;
@ -103,12 +105,30 @@ public class PatrolTask extends BaseEntity {
if (this == object) return true; if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false; if (object == null || getClass() != object.getClass()) return false;
PatrolTask that = (PatrolTask) object; PatrolTask that = (PatrolTask) object;
return intervalNumber == that.intervalNumber && Objects.equals(taskId, that.taskId) && Objects.equals(stationName, that.stationName) && Objects.equals(stationCode, that.stationCode) && Objects.equals(type, that.type) && Objects.equals(taskCode, that.taskCode) && Objects.equals(taskName, that.taskName) && Objects.equals(priority, that.priority) && Objects.equals(deviceLevel, that.deviceLevel) && Objects.equals(deviceList, that.deviceList) && Objects.equals(fixedStartTime, that.fixedStartTime) && Objects.equals(cycleMonth, that.cycleMonth) && Objects.equals(cycleWeek, that.cycleWeek) && Objects.equals(cycleExecuteTime, that.cycleExecuteTime) && Objects.equals(cycleStartTime, that.cycleStartTime) && Objects.equals(cycleEndTime, that.cycleEndTime) && Objects.equals(intervalType, that.intervalType) && Objects.equals(intervalExecuteTime, that.intervalExecuteTime) && Objects.equals(intervalStartTime, that.intervalStartTime) && Objects.equals(intervalEndTime, that.intervalEndTime) && Objects.equals(invalidStartTime, that.invalidStartTime) && Objects.equals(invalidEndTime, that.invalidEndTime) && Objects.equals(isEnable, that.isEnable) && Objects.equals(linkageState, that.linkageState) && Objects.equals(devType, that.devType) && Objects.equals(creator, that.creator) && Objects.equals(executionStatus, that.executionStatus) && Objects.equals(fileStatus, that.fileStatus) && Objects.equals(taskCycle, that.taskCycle) && Objects.equals(devNo, that.devNo) && Objects.equals(storage, that.storage) && Objects.equals(taskProgress, that.taskProgress) && Objects.equals(taskState, that.taskState) && Objects.equals(executionMode, that.executionMode) && Objects.equals(beginTime, that.beginTime) && Objects.equals(endTime, that.endTime) && Objects.equals(areaId, that.areaId) && Objects.equals(areaName, that.areaName) && Objects.equals(eqPointList, that.eqPointList) && Objects.equals(patrolTaskStatusList, that.patrolTaskStatusList);
return intervalNumber == that.intervalNumber && Objects.equals(taskId, that.taskId) && Objects.equals(stationName, that.stationName) && Objects.equals(stationCode, that.stationCode) && Objects.equals(type, that.type) && Objects.equals(taskCode, that.taskCode) && Objects.equals(taskName, that.taskName) && Objects.equals(priority, that.priority) && Objects.equals(deviceLevel, that.deviceLevel) && Objects.equals(deviceList, that.deviceList) && Objects.equals(fixedStartTime, that.fixedStartTime) && Objects.equals(cycleMonth, that.cycleMonth) && Objects.equals(cycleWeek, that.cycleWeek) && Objects.equals(cycleExecuteTime, that.cycleExecuteTime) && Objects.equals(cycleStartTime, that.cycleStartTime) && Objects.equals(cycleEndTime, that.cycleEndTime) && Objects.equals(intervalType, that.intervalType) && Objects.equals(intervalExecuteTime, that.intervalExecuteTime) && Objects.equals(intervalStartTime, that.intervalStartTime) && Objects.equals(intervalEndTime, that.intervalEndTime) && Objects.equals(invalidStartTime, that.invalidStartTime) && Objects.equals(invalidEndTime, that.invalidEndTime) && Objects.equals(isEnable, that.isEnable) && Objects.equals(isenable, that.isenable) && Objects.equals(linkageState, that.linkageState) && Objects.equals(devType, that.devType) && Objects.equals(creator, that.creator) && Objects.equals(executionStatus, that.executionStatus) && Objects.equals(fileStatus, that.fileStatus) && Objects.equals(taskCycle, that.taskCycle) && Objects.equals(devNo, that.devNo) && Objects.equals(storage, that.storage) && Objects.equals(taskProgress, that.taskProgress) && Objects.equals(taskState, that.taskState) && Objects.equals(executionMode, that.executionMode) && Objects.equals(beginTime, that.beginTime) && Objects.equals(endTime, that.endTime) && Objects.equals(areaId, that.areaId) && Objects.equals(areaName, that.areaName) && Objects.equals(eqPointList, that.eqPointList) && Objects.equals(patrolTaskStatusList, that.patrolTaskStatusList);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(taskId, stationName, stationCode, type, taskCode, taskName, priority, deviceLevel, deviceList, fixedStartTime, cycleMonth, cycleWeek, cycleExecuteTime, cycleStartTime, cycleEndTime, intervalNumber, intervalType, intervalExecuteTime, intervalStartTime, intervalEndTime, invalidStartTime, invalidEndTime, isEnable, linkageState, devType, creator, executionStatus, fileStatus, taskCycle, devNo, storage, taskProgress, taskState, executionMode, beginTime, endTime, areaId, areaName, eqPointList, patrolTaskStatusList);
return Objects.hash(taskId, stationName, stationCode, type, taskCode, taskName, priority, deviceLevel, deviceList, fixedStartTime, cycleMonth, cycleWeek, cycleExecuteTime, cycleStartTime, cycleEndTime, intervalNumber, intervalType, intervalExecuteTime, intervalStartTime, intervalEndTime, invalidStartTime, invalidEndTime, isEnable, isenable, linkageState, devType, creator, executionStatus, fileStatus, taskCycle, devNo, storage, taskProgress, taskState, executionMode, beginTime, endTime, areaId, areaName, eqPointList, patrolTaskStatusList);
}
public void setIsEnable(String isEnable) {
this.isEnable = isEnable;
this.isenable = isEnable;
}
public String getIsEnable() {
return isEnable;
}
public void setIsenable(String isenable) {
this.isenable = isenable;
this.isEnable = isenable;
}
public String getIsenable() {
return isenable;
} }
@Override @Override
@ -137,6 +157,7 @@ public class PatrolTask extends BaseEntity {
", invalidStartTime=" + invalidStartTime + ", invalidStartTime=" + invalidStartTime +
", invalidEndTime=" + invalidEndTime + ", invalidEndTime=" + invalidEndTime +
", isEnable='" + isEnable + '\'' + ", isEnable='" + isEnable + '\'' +
", isenable='" + isenable + '\'' +
", linkageState='" + linkageState + '\'' + ", linkageState='" + linkageState + '\'' +
", devType='" + devType + '\'' + ", devType='" + devType + '\'' +
", creator='" + creator + '\'' + ", creator='" + creator + '\'' +


+ 7
- 1
inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java View File

@ -2086,7 +2086,13 @@ public class JobMainTask {
String[] keywords = StringUtils.split(redisKey, StringUtils.AT); String[] keywords = StringUtils.split(redisKey, StringUtils.AT);
if (keywords.length == 3) { if (keywords.length == 3) {
String taskCode = keywords[1]; String taskCode = keywords[1];
if (isTaskSlotEmpty(taskCode)) {
List<PatrolTask> patrolTasks = taskExecClient.selectPatrolTaskList(PatrolTask.builder().taskCode(taskCode).build());
if (patrolTasks.isEmpty()) {
continue;
}
String isEnable = patrolTasks.get(0).getIsEnable();
log.info("---execEveryDayTask isEnable: {}, taskCode: {}", isEnable, taskCode);
if (isTaskSlotEmpty(taskCode) && "0".equals(isEnable)) {
log.info(Color.YELLOW + "[JOB] TASK_CODE: {}" + Color.END, taskCode); log.info(Color.YELLOW + "[JOB] TASK_CODE: {}" + Color.END, taskCode);
// long currentTime = System.currentTimeMillis(); // long currentTime = System.currentTimeMillis();
// long currentDays = TimeUnit.MILLISECONDS.toDays(currentTime); // long currentDays = TimeUnit.MILLISECONDS.toDays(currentTime);


+ 6
- 0
inspect-main/inspect-main-task-exec/src/main/java/com/inspect/exec/controller/PatrolTaskExecController.java View File

@ -166,6 +166,12 @@ public class PatrolTaskExecController extends BaseController {
return resultList; return resultList;
} }
@PostMapping({"/selectPatrolTaskList"})
@ResponseBody
public List<PatrolTask> selectPatrolTaskList(@RequestBody PatrolTask patrolTask) {
return patrolTaskService.selectPatrolTaskList(patrolTask);
}
@PostMapping({"/selectTaskInfoList"}) @PostMapping({"/selectTaskInfoList"})
@ResponseBody @ResponseBody
public List<PatrolTaskInfo> selectTaskInfoList(@RequestBody PatrolTaskInfo patrolTask) { public List<PatrolTaskInfo> selectTaskInfoList(@RequestBody PatrolTaskInfo patrolTask) {


+ 2
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java View File

@ -1938,6 +1938,7 @@ public class PatrolResultController extends BaseController {
ArrayList items; ArrayList items;
Iterator iterator; Iterator iterator;
if (contype.equals("2")) { if (contype.equals("2")) {
// 同步任务文件
maintAreaList = patrolTaskService.selectPatrolTaskList(new PatrolTask()); maintAreaList = patrolTaskService.selectPatrolTaskList(new PatrolTask());
if (null != maintAreaList && !maintAreaList.isEmpty()) { if (null != maintAreaList && !maintAreaList.isEmpty()) {
items = new ArrayList<>(); items = new ArrayList<>();
@ -2009,6 +2010,7 @@ public class PatrolResultController extends BaseController {
modelXml = pulseGet.getXml(pd); modelXml = pulseGet.getXml(pd);
} }
} else if (contype.equals("3")) { } else if (contype.equals("3")) {
// 同步维护区域文件
maintAreaList = maintainRegionService.selectMaintainRegionList(new MaintainRegion()); maintAreaList = maintainRegionService.selectMaintainRegionList(new MaintainRegion());
if (null != maintAreaList && !maintAreaList.isEmpty()) { if (null != maintAreaList && !maintAreaList.isEmpty()) {
items = new ArrayList<>(); items = new ArrayList<>();


+ 3
- 3
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java View File

@ -593,7 +593,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
String AiNum = statisticsAnalyseNumLingZhou(lineIds); String AiNum = statisticsAnalyseNumLingZhou(lineIds);
// String[] nums = new String[]{AiNum, filterNum}; // String[] nums = new String[]{AiNum, filterNum};
String[] nums = new String[]{AiNum}; String[] nums = new String[]{AiNum};
startTime = PrintUtil.useTime("STATISTICS ANALYZE DATA", startTime);
startTime = PrintUtil.useTime("STATISTICS ANALYZE DATA", startTime); // 26s
if (resultList.isEmpty()) { if (resultList.isEmpty()) {
throw new ServiceException("LACK INSPECT RESULT: " + mainId); throw new ServiceException("LACK INSPECT RESULT: " + mainId);
} else { } else {
@ -681,9 +681,9 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
report.setFilter(String.valueOf(i)); report.setFilter(String.valueOf(i));
report.setStationType(stationType); report.setStationType(stationType);
inspectionReportMapper.insertInspectionReport(report); inspectionReportMapper.insertInspectionReport(report);
PrintUtil.useTime("NEW TASK REPORT", startTime);
PrintUtil.useTime("NEW TASK REPORT", startTime); // 12s
batchInsertReportData(String.valueOf(report.getLineId()), lineIds, String.valueOf(i), patrolResultRefs); batchInsertReportData(String.valueOf(report.getLineId()), lineIds, String.valueOf(i), patrolResultRefs);
PrintUtil.useTime("BATCH INSERT DETAIL", startTime);
PrintUtil.useTime("BATCH INSERT DETAIL", startTime); // 13s
log.info("[ARCHIVE] reportId: {}", report.getLineId()); log.info("[ARCHIVE] reportId: {}", report.getLineId());
Long lineId = report.getLineId(); Long lineId = report.getLineId();
reportIds.add(lineId); reportIds.add(lineId);


+ 36
- 9
inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java View File

@ -669,12 +669,13 @@ public class PatrolTaskController extends BaseController {
Long majorId = patrolTask.getTaskId(); Long majorId = patrolTask.getTaskId();
PatrolTaskInfo patrolTaskInfo = new PatrolTaskInfo(); PatrolTaskInfo patrolTaskInfo = new PatrolTaskInfo();
patrolTaskInfo.setTaskMajorId(majorId + ""); patrolTaskInfo.setTaskMajorId(majorId + "");
List<PatrolTaskInfo> infolist = patrolTaskInfoService.selectPatrolTaskInfoList(patrolTaskInfo);
if (!infolist.isEmpty()) {
for (PatrolTaskInfo arr : infolist) {
patrolTaskInfoService.deletePatrolTaskInfoByLineId(arr.getLineId());
}
}
patrolTaskInfoService.deletePatrolTaskInfoByMajorId(majorId);
// List<PatrolTaskInfo> infolist = patrolTaskInfoService.selectPatrolTaskInfoList(patrolTaskInfo);
// if (!infolist.isEmpty()) {
// for (PatrolTaskInfo arr : infolist) {
// patrolTaskInfoService.deletePatrolTaskInfoByLineId(arr.getLineId());
// }
// }
// patrolTask.setTaskId((long) taskId); // patrolTask.setTaskId((long) taskId);
if (patrolTask.getIsUp() == null || StringUtils.isEmpty(patrolTask.getIsUp())) { if (patrolTask.getIsUp() == null || StringUtils.isEmpty(patrolTask.getIsUp())) {
// PatrolTask patrolTaskTemp = patrolTaskService.selectPatrolTaskByTaskId((long) taskId); // PatrolTask patrolTaskTemp = patrolTaskService.selectPatrolTaskByTaskId((long) taskId);
@ -683,8 +684,28 @@ public class PatrolTaskController extends BaseController {
patrolTask.setTaskCode(patrolTask.getTaskId() + ""); patrolTask.setTaskCode(patrolTask.getTaskId() + "");
} }
List<PrevPoint> prevPoints = patrolTask.getPrevPoints(); List<PrevPoint> prevPoints = patrolTask.getPrevPoints();
List<String> eqpBookIds = prevPoints.parallelStream().map(PrevPoint::getEqpBookId).collect(Collectors.toList());
List<String> parentIds = prevPoints.parallelStream().map(PrevPoint::getParentId)
.filter(Objects::nonNull)
.filter((item) -> item.contains(StringUtils.DASH))
.map((item) -> item.split(StringUtils.DASH)[1])
.collect(Collectors.toList());
List<Map<String, String>> list = new ArrayList<>();
Map<String, Map<String, String>> eqpBooksMap = new HashMap<>();
if (eqpBookIds.size() > 0) {
list = patrolTaskInfoService.selectVideoPosByPointIdByEqpbookIds(eqpBookIds);
eqpBooksMap = list.stream().collect(Collectors.toMap(e -> String.valueOf(e.get("eqp_book_id")), e -> e, (e1, e2) -> e2));
}
List<PatrolTaskInfo> patrolTaskInfoListDb = new ArrayList<>();
Map<String, PatrolTaskInfo> patrolTaskInfoMap = new HashMap<>();
if (parentIds.size() > 0) {
patrolTaskInfoListDb = patrolTaskInfoService.selectTaskInfoByBaseIds(parentIds);
patrolTaskInfoMap = patrolTaskInfoListDb.stream().collect(Collectors.toMap(PatrolTaskInfo::getDeviceId, e -> e, (e1, e2) -> e2));
}
List<PatrolTaskInfo> patrolTaskInfos = new ArrayList<>();
for (PrevPoint prevPoint : prevPoints) { for (PrevPoint prevPoint : prevPoints) {
Map<String, String> videoPos = patrolTaskInfoService.selectVideoPosByPointId(prevPoint.getEqpBookId());
// Map<String, String> videoPos = patrolTaskInfoService.selectVideoPosByPointId(prevPoint.getEqpBookId());
Map<String, String> videoPos = eqpBooksMap.get(prevPoint.getEqpBookId());
String type = videoPos.get("type"); String type = videoPos.get("type");
String patrolDeviceCode = videoPos.get("patrol_device_code"); String patrolDeviceCode = videoPos.get("patrol_device_code");
String typeEx; String typeEx;
@ -698,7 +719,8 @@ public class PatrolTaskController extends BaseController {
if (prevPoint.getParentId().contains(StringUtils.DASH)) { if (prevPoint.getParentId().contains(StringUtils.DASH)) {
String[] str = prevPoint.getParentId().split(StringUtils.DASH); String[] str = prevPoint.getParentId().split(StringUtils.DASH);
PatrolTaskInfo patrolInfo = patrolTaskInfoService.selectTaskInfoByBaseId(str[1]);
// PatrolTaskInfo patrolInfo = patrolTaskInfoService.selectTaskInfoByBaseId(str[1]);
PatrolTaskInfo patrolInfo = patrolTaskInfoMap.get(str[1]);
patrolInfo.setTaskMajorId(String.valueOf(majorId)); patrolInfo.setTaskMajorId(String.valueOf(majorId));
patrolInfo.setPresetCode(prevPoint.getPresetCode()); patrolInfo.setPresetCode(prevPoint.getPresetCode());
patrolInfo.setDeviceId(str[1]); patrolInfo.setDeviceId(str[1]);
@ -707,9 +729,14 @@ public class PatrolTaskController extends BaseController {
patrolInfo.setParentId(prevPoint.getParentId()); patrolInfo.setParentId(prevPoint.getParentId());
patrolInfo.setEbookId(prevPoint.getEqpBookId()); patrolInfo.setEbookId(prevPoint.getEqpBookId());
patrolInfo.setEbookName(prevPoint.getLabel()); patrolInfo.setEbookName(prevPoint.getLabel());
patrolTaskInfoService.insertPatrolTaskInfo(patrolInfo);
patrolInfo.setCreateTime(new Date());
patrolTaskInfos.add(patrolInfo);
// patrolTaskInfoService.insertPatrolTaskInfo(patrolInfo);
} }
} }
if (patrolTaskInfos.size() > 0) {
patrolTaskInfoService.batchInsertPatrolTaskInfo(patrolTaskInfos);
}
} }
issueTask(patrolTask); issueTask(patrolTask);
// 修改任务删除原有的任务执行策略根据新的策略重新生成 // 修改任务删除原有的任务执行策略根据新的策略重新生成


+ 7
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/mapper/PatrolTaskInfoMapper.java View File

@ -14,10 +14,14 @@ public interface PatrolTaskInfoMapper {
PatrolTaskInfo selectTaskInfoByBaseId(String baseId); PatrolTaskInfo selectTaskInfoByBaseId(String baseId);
List<PatrolTaskInfo> selectTaskInfoByBaseIds(@Param("baseIds") List<String> baseIds);
String selectAlgSubtypeIdsByPatrolPointId(String patrolPointId); String selectAlgSubtypeIdsByPatrolPointId(String patrolPointId);
Map<String, String> selectVideoPosByPointId(String pointId); Map<String, String> selectVideoPosByPointId(String pointId);
List<Map<String, String>> selectVideoPosByPointIdByEqpbookIds(@Param("list") List<String> pointIds);
Map<String, String> selectPoseInfo(@Param("devId") String devId, @Param("eqbookId") String eqBookId); Map<String, String> selectPoseInfo(@Param("devId") String devId, @Param("eqbookId") String eqBookId);
List<PatrolTaskInfo> selectPatrolTaskInfoList(PatrolTaskInfo patrolTaskInfo); List<PatrolTaskInfo> selectPatrolTaskInfoList(PatrolTaskInfo patrolTaskInfo);
@ -34,6 +38,8 @@ public interface PatrolTaskInfoMapper {
int insertPatrolTaskInfo(PatrolTaskInfo patrolTaskInfo); int insertPatrolTaskInfo(PatrolTaskInfo patrolTaskInfo);
int batchInsertPatrolTaskInfo(@Param("patrolTaskInfos") List<PatrolTaskInfo> patrolTaskInfos);
int updatePatrolTaskInfo(PatrolTaskInfo patrolTaskInfo); int updatePatrolTaskInfo(PatrolTaskInfo patrolTaskInfo);
int deletePatrolTaskInfoByLineId(Long lineIds); int deletePatrolTaskInfoByLineId(Long lineIds);
@ -44,4 +50,5 @@ public interface PatrolTaskInfoMapper {
List<Map<String, Object>> selectPatrolTaskInfoCount(@Param("list") List<String> taskInfoIds); List<Map<String, Object>> selectPatrolTaskInfoCount(@Param("list") List<String> taskInfoIds);
int deletePatrolTaskInfoByMajorId(Long taskMajorId);
} }

+ 7
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/service/IPatrolTaskInfoService.java View File

@ -10,11 +10,14 @@ public interface IPatrolTaskInfoService {
PatrolTaskInfo selectPatrolTaskInfoByLineId(Long lineId); PatrolTaskInfo selectPatrolTaskInfoByLineId(Long lineId);
PatrolTaskInfo selectTaskInfoByBaseId(String baseId); PatrolTaskInfo selectTaskInfoByBaseId(String baseId);
List<PatrolTaskInfo> selectTaskInfoByBaseIds(List<String> baseIds);
String selectAlgSubtypeIdsByPatrolPointId(String patrolPointId); String selectAlgSubtypeIdsByPatrolPointId(String patrolPointId);
Map<String, String> selectVideoPosByPointId(String pointId); Map<String, String> selectVideoPosByPointId(String pointId);
List<Map<String, String>> selectVideoPosByPointIdByEqpbookIds(List<String> pointIds);
Map<String, String> selectPoseInfo(String key, String key2); Map<String, String> selectPoseInfo(String key, String key2);
List<PatrolTaskInfo> selectPatrolTaskInfoList(PatrolTaskInfo info); List<PatrolTaskInfo> selectPatrolTaskInfoList(PatrolTaskInfo info);
@ -27,6 +30,8 @@ public interface IPatrolTaskInfoService {
int insertPatrolTaskInfo(PatrolTaskInfo patrolTaskInfo); int insertPatrolTaskInfo(PatrolTaskInfo patrolTaskInfo);
int batchInsertPatrolTaskInfo(List<PatrolTaskInfo> patrolTaskInfo);
int updatePatrolTaskInfo(PatrolTaskInfo patrolTaskInfo); int updatePatrolTaskInfo(PatrolTaskInfo patrolTaskInfo);
int deletePatrolTaskInfoByLineIds(Long[] lineIds); int deletePatrolTaskInfoByLineIds(Long[] lineIds);
@ -36,4 +41,6 @@ public interface IPatrolTaskInfoService {
int deletePatrolTaskInfoByMajorIds(Long[] majorIds); int deletePatrolTaskInfoByMajorIds(Long[] majorIds);
List<Map<String, Object>> selectPatrolTaskInfoCount(List<String> taskInfoIds); List<Map<String, Object>> selectPatrolTaskInfoCount(List<String> taskInfoIds);
int deletePatrolTaskInfoByMajorId(Long majorId);
} }

+ 16
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/taskinfo/service/impl/PatrolTaskInfoServiceImpl.java View File

@ -26,6 +26,10 @@ public class PatrolTaskInfoServiceImpl implements IPatrolTaskInfoService {
return this.patrolTaskInfoMapper.selectTaskInfoByBaseId(lineId); return this.patrolTaskInfoMapper.selectTaskInfoByBaseId(lineId);
} }
public List<PatrolTaskInfo> selectTaskInfoByBaseIds(List<String> baseIds) {
return this.patrolTaskInfoMapper.selectTaskInfoByBaseIds(baseIds);
}
public String selectAlgSubtypeIdsByPatrolPointId(String patrolPointId) { public String selectAlgSubtypeIdsByPatrolPointId(String patrolPointId) {
return this.patrolTaskInfoMapper.selectAlgSubtypeIdsByPatrolPointId(patrolPointId); return this.patrolTaskInfoMapper.selectAlgSubtypeIdsByPatrolPointId(patrolPointId);
} }
@ -34,6 +38,10 @@ public class PatrolTaskInfoServiceImpl implements IPatrolTaskInfoService {
return this.patrolTaskInfoMapper.selectVideoPosByPointId(lineId); return this.patrolTaskInfoMapper.selectVideoPosByPointId(lineId);
} }
public List<Map<String, String>> selectVideoPosByPointIdByEqpbookIds(List<String> pointIds) {
return this.patrolTaskInfoMapper.selectVideoPosByPointIdByEqpbookIds(pointIds);
}
public Map<String, String> selectPoseInfo(String devId, String eqBookId) { public Map<String, String> selectPoseInfo(String devId, String eqBookId) {
return this.patrolTaskInfoMapper.selectPoseInfo(devId, eqBookId); return this.patrolTaskInfoMapper.selectPoseInfo(devId, eqBookId);
} }
@ -76,6 +84,10 @@ public class PatrolTaskInfoServiceImpl implements IPatrolTaskInfoService {
return this.patrolTaskInfoMapper.insertPatrolTaskInfo(patrolTaskInfo); return this.patrolTaskInfoMapper.insertPatrolTaskInfo(patrolTaskInfo);
} }
public int batchInsertPatrolTaskInfo(List<PatrolTaskInfo> patrolTaskInfos) {
return this.patrolTaskInfoMapper.batchInsertPatrolTaskInfo(patrolTaskInfos);
}
public int updatePatrolTaskInfo(PatrolTaskInfo patrolTaskInfo) { public int updatePatrolTaskInfo(PatrolTaskInfo patrolTaskInfo) {
return this.patrolTaskInfoMapper.updatePatrolTaskInfo(patrolTaskInfo); return this.patrolTaskInfoMapper.updatePatrolTaskInfo(patrolTaskInfo);
} }
@ -95,4 +107,8 @@ public class PatrolTaskInfoServiceImpl implements IPatrolTaskInfoService {
public List<Map<String, Object>> selectPatrolTaskInfoCount(List<String> taskInfoIds) { public List<Map<String, Object>> selectPatrolTaskInfoCount(List<String> taskInfoIds) {
return this.patrolTaskInfoMapper.selectPatrolTaskInfoCount(taskInfoIds); return this.patrolTaskInfoMapper.selectPatrolTaskInfoCount(taskInfoIds);
} }
public int deletePatrolTaskInfoByMajorId(Long taskMajorId) {
return this.patrolTaskInfoMapper.deletePatrolTaskInfoByMajorId(taskMajorId);
}
} }

+ 40
- 0
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskInfoMapper.xml View File

@ -147,6 +147,18 @@
where a.patrol_point_id = #{lineId} where a.patrol_point_id = #{lineId}
</select> </select>
<select id="selectTaskInfoByBaseIds" resultMap="PatrolTaskInfoResult">
select a.patrol_point_name as device_name,
a.device_id as component_id,
a.main_device_id as main_device_id,
a.patrol_point_id as device_id
from basedata_patrolpoint a
where a.patrol_point_id in
<foreach item="pointId" collection="baseIds" open="(" separator="," close=")">
#{pointId}
</foreach>
</select>
<select id="selectAlgSubtypeIdsByPatrolPointId" parameterType="String" resultType="String"> <select id="selectAlgSubtypeIdsByPatrolPointId" parameterType="String" resultType="String">
select a.alg_subtype_ids as algSubtypeIds select a.alg_subtype_ids as algSubtypeIds
from basedata_patrolpoint a from basedata_patrolpoint a
@ -174,6 +186,14 @@
</foreach> </foreach>
group by taskMajorId group by taskMajorId
</select> </select>
<select id="selectVideoPosByPointIdByEqpbookIds" resultType="java.util.Map">
select a.*
from basedata_eqpbook a
where a.eqp_book_id in
<foreach item="pointId" collection="list" open="(" separator="," close=")">
#{pointId}
</foreach>
</select>
<insert id="insertPatrolTaskInfo" parameterType="PatrolTaskInfo" useGeneratedKeys="true" keyProperty="lineId"> <insert id="insertPatrolTaskInfo" parameterType="PatrolTaskInfo" useGeneratedKeys="true" keyProperty="lineId">
@ -217,6 +237,23 @@
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
</trim> </trim>
</insert> </insert>
<insert id="batchInsertPatrolTaskInfo">
INSERT INTO patrol_task_info (
task_major_id, device_id, device_name, component_id, component_name,
bay_id, bay_name, main_device_id, main_device_name, phy_asset_id,
dev_type, preset_code, parent_id, ebook_id, ebook_name, dev_no, create_time
) VALUES
<foreach collection="patrolTaskInfos" item="item" separator=",">
(
#{item.taskMajorId}, #{item.deviceId}, #{item.deviceName},
#{item.componentId}, #{item.componentName}, #{item.bayId},
#{item.bayName}, #{item.mainDeviceId}, #{item.mainDeviceName},
#{item.phyAssetId}, #{item.devType}, #{item.presetCode},
#{item.parentId}, #{item.ebookId}, #{item.ebookName},
#{item.devNo}, #{item.createTime}
)
</foreach>
</insert>
<update id="updatePatrolTaskInfo" parameterType="PatrolTaskInfo"> <update id="updatePatrolTaskInfo" parameterType="PatrolTaskInfo">
update patrol_task_info update patrol_task_info
@ -260,4 +297,7 @@
#{majorId} #{majorId}
</foreach> </foreach>
</delete> </delete>
<delete id="deletePatrolTaskInfoByMajorId">
delete from patrol_task_info where task_major_id = #{taskMajorId}
</delete>
</mapper> </mapper>

+ 1
- 1
inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml View File

@ -144,7 +144,7 @@
<select id="selectResultAnalysisListByMainIdsNew" resultMap="ResultAnalysisResult"> <select id="selectResultAnalysisListByMainIdsNew" resultMap="ResultAnalysisResult">
select b.business_id, b.point_status, b.res_status, b.alg_type,b.result_type,b.objectId,b.task_patrol_id select b.business_id, b.point_status, b.res_status, b.alg_type,b.result_type,b.objectId,b.task_patrol_id
from patrol_result a from patrol_result a
left join result_analysis b on a.line_id = b.business_id
left join result_analysis b on a.line_id = b.business_id and a.device_id = b.objectId and a.task_patrolled_id = b.task_patrol_id
where a.main_id in where a.main_id in
<foreach item="item" index="index" collection="lineIds" open="(" separator="," close=")"> <foreach item="item" index="index" collection="lineIds" open="(" separator="," close=")">
#{item} #{item}


+ 7
- 7
inspect-metadata/src/main/java/com/inspect/metadata/patrolpointmnt/service/impl/BasedataPatrolPointServiceImpl.java View File

@ -198,6 +198,7 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi
private String getModelXml(BasedataPatrolPoint basedataPatrolpoint) { private String getModelXml(BasedataPatrolPoint basedataPatrolpoint) {
List<BasedataPatrolPoint> list = this.basedataPatrolpointMapper.selectBasedataPatrolPointList(basedataPatrolpoint); List<BasedataPatrolPoint> list = this.basedataPatrolpointMapper.selectBasedataPatrolPointList(basedataPatrolpoint);
if (null != list && !list.isEmpty()) { if (null != list && !list.isEmpty()) {
logger.info("省侧点位同步[META] list size: {}", list.size());
DevicePointModel devicePointModel = new DevicePointModel(); DevicePointModel devicePointModel = new DevicePointModel();
List<DevicePointModelItem> items = new ArrayList<>(); List<DevicePointModelItem> items = new ArrayList<>();
String station_id = null; String station_id = null;
@ -337,13 +338,12 @@ public class BasedataPatrolPointServiceImpl implements IBasedataPatrolPointServi
modelItem.setPoint_type(""); modelItem.setPoint_type("");
modelItem.setLabel_attri(""); modelItem.setLabel_attri("");
if(hasChinese(main_device_id) || hasChinese(component_id) || hasChinese(device_id)) {
continue;
}
if(device_type == null || device_type.equals("10000")){
continue;
}
// if(hasChinese(main_device_id) || hasChinese(component_id) || hasChinese(device_id)) {
// continue;
// }
// if(device_type == null || device_type.equals("10000")){
// continue;
// }
items.add(modelItem); items.add(modelItem);
} }


+ 1
- 1
inspect-metadata/src/main/resources/mapper/eqpbook/BasedataEqpBookMapper.xml View File

@ -814,7 +814,7 @@
basedata_eqpbook_channel b basedata_eqpbook_channel b
WHERE a.main_system_code = #{patrolDeviceCode} WHERE a.main_system_code = #{patrolDeviceCode}
AND a.eqp_book_id = b.eqp_book_id AND a.eqp_book_id = b.eqp_book_id
AND b.channel_type = 'ir';
AND b.channel_type = 'ir' limit 1;
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save