Browse Source

优化换流变小模型接口:改写获取算法名

master
wangguangyuan 1 month ago
parent
commit
8d609c62dc
3 changed files with 13 additions and 3 deletions
  1. +2
    -0
      src/main/java/com/inspect/simulator/mapper/PatrolResultMapper.java
  2. +6
    -0
      src/main/java/com/inspect/simulator/service/impl/PatrolResultServiceImpl.java
  3. +5
    -3
      src/main/resources/mapper/PatrolResultMapper.xml

+ 2
- 0
src/main/java/com/inspect/simulator/mapper/PatrolResultMapper.java View File

@ -97,4 +97,6 @@ public interface PatrolResultMapper {
List<PatrolResult> selectPatrolResults(PatrolResultParam patrolResultParam);
String selectPatrolResultByTaskPatrolledId(@Param("taskPatrolledId") String taskPatrolledId,@Param("objectId") String objectId);
List<Map<String, String>> selectAlgSubTypeByCode();
}

+ 6
- 0
src/main/java/com/inspect/simulator/service/impl/PatrolResultServiceImpl.java View File

@ -395,6 +395,12 @@ public class PatrolResultServiceImpl implements PatrolResultService {
List<PatrolResult> finalPatrolResults = patrolResults;
patrolResults = patrolResults.parallelStream().filter(item -> finalPatrolResults.get(0).getTaskPatrolledId().equals(item.getTaskPatrolledId())).collect(Collectors.toList());
}
List<Map<String, String>> maps = patrolResultMapper.selectAlgSubTypeByCode();
Map<String, String> algMap = maps.parallelStream().collect(Collectors.toMap(map -> map.get("alg_subtype_code"), map -> map.get("alg_subtype_name"), (oldValue, newValue) -> newValue));
patrolResults.parallelStream().forEach(item -> {
item.setAlgorithmsName(algMap.getOrDefault(item.getAlgorithmsType(),""));
});
MessageBody messageBody = prepareMessageBodyToGetPatrolResults(patrolResults, patrolResultParam.getIsBase64());
return messageBody;
}


+ 5
- 3
src/main/resources/mapper/PatrolResultMapper.xml View File

@ -792,6 +792,11 @@
and f.check_time is null and a.patrol_point_id is not null
</select>
<select id="selectAlgSubTypeByCode" resultType="java.util.Map">
select a.*
from basedata_alg_subtype a
</select>
<select id="selectPatrolResults" resultType="com.inspect.simulator.domain.result.PatrolResult">
select f.line_id lineId,
s.task_patrolled_id taskPatrolledId,
@ -802,7 +807,6 @@
a.patrol_point_name pointName,
f.create_time createTime,
f.file_path filePath,
bas.alg_subtype_name algorithmsName,
ra.alg_type algorithmsType,
ra.res_img_url resImgUrl,
ra.image_normal_url_path imageNormalUrlPath,
@ -816,8 +820,6 @@
left join basedata_device c on a.device_id = c.device_id
left join basedata_area e on a.area_id = e.area_id
left join basedata_area d on d.area_id = e.parent_id
left join basedata_alg_subtype bas
on bas.alg_subtype_code = ra.alg_type and find_in_set(bas.alg_subtype_id, a.alg_subtype_ids)
where
a.patrol_point_id is not null and (ra.filter = '0' or ra.filter = '1')
<if test="astId != null and astId != ''">


Loading…
Cancel
Save