|
@@ -3,6 +3,7 @@ package com.its.op.service.its.facility;
|
|
|
import com.its.op.dao.repository.its.code.TbCmmnCdRepository;
|
|
|
import com.its.op.dao.repository.its.facility.TbFcltInfrRepository;
|
|
|
import com.its.op.dto.its.cctv.TbCctvCtlrDto;
|
|
|
+import com.its.op.dto.its.common.NewIdLongDto;
|
|
|
import com.its.op.dto.its.facility.FcltWorkStepDto;
|
|
|
import com.its.op.dto.its.facility.TbFcltInfrDto;
|
|
|
import com.its.op.dto.its.facility.UnRegisteredFcltInfrDto;
|
|
@@ -139,12 +140,14 @@ public class TbFcltInfrService {
|
|
|
*/
|
|
|
@Transactional
|
|
|
public List<TbFcltInfrDto> mergeRegInfoList(List<UnRegisteredFcltInfrDto.TbRegFcltInfrUpdReq> listReq) {
|
|
|
+ NewIdLongDto fcltNmbrDto = getNewNmbr();
|
|
|
+ Long fcltNmbr = fcltNmbrDto.getNewId();
|
|
|
List<TbFcltInfrDto> result = new ArrayList<>();
|
|
|
- listReq.forEach(obj -> {
|
|
|
- TbFcltInfr entity = obj.toEntity();
|
|
|
+ for (UnRegisteredFcltInfrDto.TbRegFcltInfrUpdReq obj : listReq) {
|
|
|
+ TbFcltInfr entity = obj.toEntity(fcltNmbr++);
|
|
|
this.repo.save(entity);
|
|
|
result.add(entity.toDto());
|
|
|
- });
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -224,4 +227,10 @@ public class TbFcltInfrService {
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+ @Transactional(readOnly = true)
|
|
|
+ public NewIdLongDto getNewNmbr() {
|
|
|
+ Long newId = this.repo.getNewNmbr();
|
|
|
+ return NewIdLongDto.builder().newId(newId).build();
|
|
|
+ }
|
|
|
+
|
|
|
}
|