|
|
@@ -231,11 +231,11 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
page.setSize(queryInspectionRequest.getLimit()); |
|
|
|
page.setCurrent(queryInspectionRequest.getPage()); |
|
|
|
queryInspectionRequest.setTenantId(ShiroUtils.getTenantId()); |
|
|
|
LambdaQueryWrapper<ThMission> queryInspection=new LambdaQueryWrapper<>(); |
|
|
|
queryParam(queryInspectionRequest, queryInspection); |
|
|
|
queryInspection.eq(ThMission::getMark,MarkTypeEnum.VALID.getCode()).orderByDesc(ThMission::getCreateTime); |
|
|
|
LambdaQueryWrapper<ThMission> queryMission=new LambdaQueryWrapper<>(); |
|
|
|
queryParam(queryInspectionRequest, queryMission); |
|
|
|
queryMission.eq(ThMission::getMark,MarkTypeEnum.VALID.getCode()).orderByDesc(ThMission::getCreateTime); |
|
|
|
|
|
|
|
IPage<ThMission> thMissionIPage = thMissionMapper.selectPage(page, queryInspection); |
|
|
|
IPage<ThMission> thMissionIPage = thMissionMapper.selectPage(page, queryMission); |
|
|
|
List<ThMission> records = thMissionIPage.getRecords(); |
|
|
|
|
|
|
|
Map<Integer, String> userName = getUserNameMap(records); |
|
|
@@ -243,10 +243,25 @@ public class MissionServiceImpl extends BaseServiceImpl<ThMissionMapper, ThMissi |
|
|
|
records.forEach(mission->{ |
|
|
|
MissionVO missionVO=new MissionVO(); |
|
|
|
BeanUtils.copyProperties(mission,missionVO); |
|
|
|
|
|
|
|
//获取最后一次的飞行时间 |
|
|
|
if(missionVO.getStatus().equals(TaskStatusEnum.COMPLETE.getCode())) { |
|
|
|
LambdaQueryWrapper<ThInspection> lambdaInspection = new LambdaQueryWrapper<>(); |
|
|
|
lambdaInspection.eq(ThInspection::getMissionId, mission.getId()); |
|
|
|
lambdaInspection.eq(ThInspection::getMark, MarkTypeEnum.VALID.getCode()).orderByDesc(ThInspection::getCreateTime); |
|
|
|
List<ThInspection> thInspections = inspectionMapper.selectList(lambdaInspection); |
|
|
|
if (ObjectUtil.isNotEmpty(thInspections) && thInspections.size() > 0) { |
|
|
|
ThInspection temp = thInspections.get(0); |
|
|
|
missionVO.setFlyTime(temp.getFlyTime() / 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
missionVO.setCreateUser(userName.get(mission.getCreateUser())); |
|
|
|
result.add(missionVO); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<MissionVO> resultPage=new Page<>(); |
|
|
|
resultPage.setCurrent(thMissionIPage.getCurrent()); |
|
|
|
resultPage.setPages(thMissionIPage.getPages()); |