Commit c68e8fa0 authored by 韩桐桐's avatar 韩桐桐

fix(jg):检验检测信息查询确保是最新的一条数据

parent 74fa4c51
...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service; ...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -39,9 +40,16 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB ...@@ -39,9 +40,16 @@ public class IdxBizJgInspectionDetectionInfoServiceImpl extends BaseService<IdxB
@Override @Override
public List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records) { public List<IdxBizJgInspectionDetectionInfo> checkInspectionInfo(List<String> records) {
IdxBizJgInspectionDetectionInfo result = new IdxBizJgInspectionDetectionInfo(); ArrayList<IdxBizJgInspectionDetectionInfo> result = new ArrayList<>();
QueryWrapper<IdxBizJgInspectionDetectionInfo> queryWrapper = new QueryWrapper<>(); for (String record : records) {
queryWrapper.lambda().in(IdxBizJgInspectionDetectionInfo::getRecord, records).orderByDesc(IdxBizJgInspectionDetectionInfo::getInspectDate); QueryWrapper<IdxBizJgInspectionDetectionInfo> queryWrapper = new QueryWrapper<>();
return list(queryWrapper); queryWrapper.lambda().eq(IdxBizJgInspectionDetectionInfo::getRecord, record)
.orderByDesc(IdxBizJgInspectionDetectionInfo::getInspectDate);
List<IdxBizJgInspectionDetectionInfo> list = list(queryWrapper);
if (!ValidationUtil.isEmpty(list)){
result.add(list.get(0));
}
}
return result;
} }
} }
\ 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