[KC-108] 분석도엽 ai api호출 테스트
This commit is contained in:
@@ -6,6 +6,7 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetNumDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
|
||||
@@ -59,6 +60,14 @@ public class InferenceResultCoreService {
|
||||
* @param req
|
||||
*/
|
||||
public UUID saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
String mapSheetName =
|
||||
req.getMapSheetNum().get(0).getMapSheetName() + " 외 " + req.getMapSheetNum().size() + "건";
|
||||
|
||||
if (req.getMapSheetNum().size() == 1) {
|
||||
mapSheetName =
|
||||
req.getMapSheetNum().get(0).getMapSheetName() + " " + req.getMapSheetNum().size() + "건";
|
||||
}
|
||||
|
||||
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
|
||||
mapSheetLearnEntity.setTitle(req.getTitle());
|
||||
mapSheetLearnEntity.setM1ModelUuid(req.getModel1Uuid());
|
||||
@@ -69,19 +78,20 @@ public class InferenceResultCoreService {
|
||||
mapSheetLearnEntity.setMapSheetScope(req.getMapSheetScope());
|
||||
mapSheetLearnEntity.setDetectOption(req.getDetectOption());
|
||||
mapSheetLearnEntity.setCreatedUid(userUtil.getId());
|
||||
mapSheetLearnEntity.setMapSheetCnt(mapSheetName);
|
||||
mapSheetLearnEntity.setDetectingCnt((long) req.getMapSheetNum().size());
|
||||
|
||||
// learn 테이블 저장
|
||||
MapSheetLearnEntity savedLearn = mapSheetLearnRepository.save(mapSheetLearnEntity);
|
||||
|
||||
final int CHUNK = 1000;
|
||||
List<MapSheetLearn5kEntity> buffer = new ArrayList<>(CHUNK);
|
||||
List<String> mapSheetNumList = req.getMapSheetNum();
|
||||
|
||||
// learn 도엽 저장
|
||||
for (String mapSheetNum : mapSheetNumList) {
|
||||
for (MapSheetNumDto mapSheetNum : req.getMapSheetNum()) {
|
||||
MapSheetLearn5kEntity e = new MapSheetLearn5kEntity();
|
||||
e.setLearn(savedLearn);
|
||||
e.setMapSheetNum(Long.parseLong(mapSheetNum));
|
||||
e.setMapSheetNum(Long.parseLong(mapSheetNum.getMapSheetNum()));
|
||||
e.setCreatedUid(userUtil.getId());
|
||||
buffer.add(e);
|
||||
|
||||
|
||||
@@ -166,10 +166,11 @@ public class MapInkx5kRepositoryImpl extends QuerydslRepositorySupport
|
||||
mapInkx5kEntity.fid,
|
||||
mapInkx5kEntity.mapidcdNo,
|
||||
mapInkx5kEntity.mapidNm,
|
||||
mapInkx5kEntity.geom,
|
||||
mapInkx5kEntity.useInference))
|
||||
.from(mapInkx5kEntity)
|
||||
.where(builder)
|
||||
// TODO limit 제거 필요
|
||||
.limit(100)
|
||||
.fetch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user