You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
VMIS-interface/src/main/java/com/vmis/interfaceapp/service/CarBassMatterInqireLogServi...

57 lines
2.5 KiB
Java

package com.vmis.interfaceapp.service;
import com.vmis.interfaceapp.mapper.CarBassMatterInqireMapper;
import com.vmis.interfaceapp.model.basic.CarBassMatterInqireVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* .
*
* <p> (REQUIRES_NEW) ,
* .</p>
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class CarBassMatterInqireLogService {
private final CarBassMatterInqireMapper carBassMatterInqireMapper;
/**
* API . (REQUIRES_NEW)
* @param request
* @return ID
*/
@Transactional(propagation = Propagation.REQUIRES_NEW)
public String createInitialRequestNewTx(CarBassMatterInqireVO request) {
String generatedId = carBassMatterInqireMapper.selectNextCarBassMatterInqireId();
request.setCarBassMatterInqireId(generatedId);
int result = carBassMatterInqireMapper.insertCarBassMatterInqire(request);
if (result != 1) {
throw new RuntimeException("자동차 기본 사항 조회 정보 등록 실패");
}
log.info("[BASIC-REQ-LOG] 요청 정보 저장 완료(별도TX) - ID: {}, 차량번호: {}", generatedId, request.getDmndVhrno());
return generatedId;
}
/**
* / . (REQUIRES_NEW)
* @param response
*/
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void updateResponseNewTx(CarBassMatterInqireVO response) {
if (response.getCarBassMatterInqireId() == null) {
throw new IllegalArgumentException("자동차 기본 사항 조회 ID는 필수입니다.");
}
int result = carBassMatterInqireMapper.updateCarBassMatterInqire(response);
if (result != 1) {
throw new RuntimeException("자동차 기본 사항 조회 정보 업데이트 실패 - ID: " + response.getCarBassMatterInqireId());
}
log.info("[BASIC-RES-LOG] 응답/에러 정보 저장 완료(별도TX) - ID: {}, 결과코드: {}", response.getCarBassMatterInqireId(), response.getCntcResultCode());
}
}