Commit 2a67f58c by liuyongshuai

1.优化伴随线程,先调取标识号,再调取关联关系,并使用批量调取;

2.修改伴随任务查询的bug,只能出来5条数据;
parent de4380e9
...@@ -20,4 +20,6 @@ public interface TrackTogetherMapper { ...@@ -20,4 +20,6 @@ public interface TrackTogetherMapper {
* @return * @return
*/ */
public List<TrackTogetherTask> queryTasksByAsjbhAndFwbsh(TrackTogetherTask taskParam); public List<TrackTogetherTask> queryTasksByAsjbhAndFwbsh(TrackTogetherTask taskParam);
int queryTasksByAsjbhAndFwbshCount(TrackTogetherTask taskParam);
} }
...@@ -238,7 +238,7 @@ public class RegionalsScheduledService { ...@@ -238,7 +238,7 @@ public class RegionalsScheduledService {
/** /**
* 通过区域碰撞的结果 使用第四个接口调取关联数据(原生方法) * 通过区域碰撞的结果 使用第四个接口调取关联数据(原生方法)
*/ */
public void getAndSaveRydetail(List<RegionalsTaskResult> resultsList) { public void getAndSaveRydetail(List<RegionalsTaskResult> resultsList) throws Exception{
if (resultsList != null && !resultsList.isEmpty()) { if (resultsList != null && !resultsList.isEmpty()) {
for (RegionalsTaskResult result : resultsList) { for (RegionalsTaskResult result : resultsList) {
String objType = result.getObjectType(); String objType = result.getObjectType();
......
...@@ -169,6 +169,7 @@ public class TrackTogetherContoller { ...@@ -169,6 +169,7 @@ public class TrackTogetherContoller {
taskParam.setBegin(begin); taskParam.setBegin(begin);
taskParam.setEnd(end); taskParam.setEnd(end);
List<TrackTogetherTask> togetherTaskLsit = trackTogetherService.queryTasksByAsjbhAndFwbsh(taskParam); List<TrackTogetherTask> togetherTaskLsit = trackTogetherService.queryTasksByAsjbhAndFwbsh(taskParam);
int count = trackTogetherService.queryTasksByAsjbhAndFwbshCount(taskParam);
if(null != togetherTaskLsit && !togetherTaskLsit.isEmpty()){ if(null != togetherTaskLsit && !togetherTaskLsit.isEmpty()){
togetherTaskVOS = new ArrayList<>(); togetherTaskVOS = new ArrayList<>();
for (TrackTogetherTask task : togetherTaskLsit) { for (TrackTogetherTask task : togetherTaskLsit) {
...@@ -207,7 +208,10 @@ public class TrackTogetherContoller { ...@@ -207,7 +208,10 @@ public class TrackTogetherContoller {
togetherTaskVO.setState("运行中"); togetherTaskVO.setState("运行中");
break; break;
case "FINISHED": case "FINISHED":
togetherTaskVO.setState("已完成"); togetherTaskVO.setState("标识号调取完成");
break;
case "END":
togetherTaskVO.setState("伴随调取完成");
break; break;
case "TIMEOUT": case "TIMEOUT":
togetherTaskVO.setState("计算超时"); togetherTaskVO.setState("计算超时");
...@@ -224,7 +228,7 @@ public class TrackTogetherContoller { ...@@ -224,7 +228,7 @@ public class TrackTogetherContoller {
}else{ }else{
togetherTaskVOS = new ArrayList<>(); togetherTaskVOS = new ArrayList<>();
} }
resultMap.put("total", togetherTaskVOS.size()); resultMap.put("total", count);
resultMap.put("rows",togetherTaskVOS); resultMap.put("rows",togetherTaskVOS);
}catch (InterServiceException e){ }catch (InterServiceException e){
e.printStackTrace(); e.printStackTrace();
......
...@@ -27,6 +27,8 @@ public interface TrackTogetherService { ...@@ -27,6 +27,8 @@ public interface TrackTogetherService {
public List<TrackTogetherTask> queryTasksByAsjbhAndFwbsh(TrackTogetherTask taskParam); public List<TrackTogetherTask> queryTasksByAsjbhAndFwbsh(TrackTogetherTask taskParam);
public int queryTasksByAsjbhAndFwbshCount(TrackTogetherTask taskParam);
public List<TogetherTaskResult> getTogetherTaskResultList(TogetherTaskResult taskParam); public List<TogetherTaskResult> getTogetherTaskResultList(TogetherTaskResult taskParam);
int getTogetherTaskResultListTotalCount(TogetherTaskResult taskParam); int getTogetherTaskResultListTotalCount(TogetherTaskResult taskParam);
......
...@@ -164,6 +164,11 @@ public class TrackTogetherServiceImpl implements TrackTogetherService { ...@@ -164,6 +164,11 @@ public class TrackTogetherServiceImpl implements TrackTogetherService {
} }
@Override @Override
public int queryTasksByAsjbhAndFwbshCount(TrackTogetherTask taskParam) {
return trackTogetherMapper.queryTasksByAsjbhAndFwbshCount(taskParam);
}
@Override
public List<TogetherTaskResult> getTogetherTaskResultList(TogetherTaskResult taskParam) { public List<TogetherTaskResult> getTogetherTaskResultList(TogetherTaskResult taskParam) {
return togetherTaskResultMapper.getTogetherTaskResultList(taskParam); return togetherTaskResultMapper.getTogetherTaskResultList(taskParam);
} }
......
...@@ -38,4 +38,21 @@ ...@@ -38,4 +38,21 @@
) t2 ) t2
where rn <![CDATA[ > ]]> #{begin } where rn <![CDATA[ > ]]> #{begin }
</select> </select>
<select id="queryTasksByAsjbhAndFwbshCount" parameterType="com.founder.interservice.tracktraveltogether.model.TrackTogetherTask" resultType="java.lang.Integer">
select
count(*)
from TB_ST_TRACKTOGETHERTASK t
<where>
<if test="taskCaseId != null and taskCaseId != ''">
t.TASK_CASE_ID = #{taskCaseId}
</if>
<if test="objectValue != null and objectValue != ''">
and t.OBJECT_VALUE = #{objectValue}
</if>
<if test="taskId != null and taskId != ''">
and t.TASK_ID = #{taskId}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment