|
|
|
|
@ -155,7 +155,7 @@ public class BsEpciuPatrolInspectionServiceImpl extends BaseServiceImpl<BsEpciuP |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<BsEpciuPatrolInspectionEntity> ListPi(String code, Short eipType) { |
|
|
|
|
public BsEpciuPatrolInspectionEntity ListPi(String code, Short eipType) { |
|
|
|
|
//String sql = "select*from(SELECT a.* FROM EP_PATROL_INSPECTION a INNER join " +
|
|
|
|
|
// "EP_INSPECTION_POINT b ON a.ip_id = b.eip_id WHERE b.patrol_register =:code AND a.task_status =:taskStatus AND b.eip_type =:eipType " +
|
|
|
|
|
// "ORDER BY a.launch_time DESC )where rownum<2 ";
|
|
|
|
|
@ -167,13 +167,21 @@ public class BsEpciuPatrolInspectionServiceImpl extends BaseServiceImpl<BsEpciuP |
|
|
|
|
|
|
|
|
|
List<BsEpciuInspectionPointEntity> safeInspectionPointList = bsEpciuInspectionPointService.listByCode(code); |
|
|
|
|
List<Long> safeInspectionPointIdList = safeInspectionPointList.stream().map(BsEpciuInspectionPointEntity::getId).toList(); |
|
|
|
|
return list(Wrappers.lambdaQuery(BsEpciuPatrolInspectionEntity.class) |
|
|
|
|
if (safeInspectionPointIdList.isEmpty()) { |
|
|
|
|
throw new RuntimeException("未查询到有效的巡检点数据"); |
|
|
|
|
} |
|
|
|
|
List<BsEpciuPatrolInspectionEntity> list = list(Wrappers.lambdaQuery(BsEpciuPatrolInspectionEntity.class) |
|
|
|
|
.in(BsEpciuPatrolInspectionEntity::getEpcId, safeInspectionPointIdList) |
|
|
|
|
.eq(BsEpciuPatrolInspectionEntity::getInsType, eipType) |
|
|
|
|
//旧mes中查询待检状态任务
|
|
|
|
|
.eq(BsEpciuPatrolInspectionEntity::getTaskStatus, BsEpciuPatrolInspectionEntity.PREPARE_TEXT.toString()) |
|
|
|
|
.orderByDesc(BsEpciuPatrolInspectionEntity::getLaunchTime) |
|
|
|
|
.last("rownum<2")); |
|
|
|
|
.orderByDesc(BsEpciuPatrolInspectionEntity::getLaunchTime)); |
|
|
|
|
if (list.size() > 0) { |
|
|
|
|
return list.get(0); |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException("未查询到有效数据"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|