견적서 잠금처리 API 개발
This commit is contained in:
parent
de39551f21
commit
455734c094
@ -79,6 +79,13 @@ public class EstimateController {
|
|||||||
return estimateService.updateEstimateReset(estimateRequest);
|
return estimateService.updateEstimateReset(estimateRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(description = "견적서를 잠금여부를 저장한다.")
|
||||||
|
@PostMapping("/save-estimate-lock")
|
||||||
|
@ResponseStatus(HttpStatus.CREATED)
|
||||||
|
public void updateEstimateLock(@RequestBody EstimateRequest estimateRequest) throws Exception {
|
||||||
|
estimateService.updateEstimateLock(estimateRequest);
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서를 엑셀로 다운로드한다.")
|
@Operation(description = "견적서를 엑셀로 다운로드한다.")
|
||||||
@PostMapping("/excel-download")
|
@PostMapping("/excel-download")
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
|
|||||||
@ -66,6 +66,9 @@ public interface EstimateMapper {
|
|||||||
// 견적서 정보 초기화
|
// 견적서 정보 초기화
|
||||||
public int updateEstimateReset(EstimateRequest estimateRequest);
|
public int updateEstimateReset(EstimateRequest estimateRequest);
|
||||||
|
|
||||||
|
// 견적서 잠금 수정
|
||||||
|
public int updateEstimateLock(EstimateRequest estimateRequest);
|
||||||
|
|
||||||
// 견적서 API 정보 수정
|
// 견적서 API 정보 수정
|
||||||
public int updateEstimateApi(EstimateRequest estimateRequest);
|
public int updateEstimateApi(EstimateRequest estimateRequest);
|
||||||
|
|
||||||
|
|||||||
@ -1180,12 +1180,43 @@ public class EstimateService {
|
|||||||
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
|
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [9]. 최종 생성 물건번호 리턴
|
// [4]. 물건번호 리턴
|
||||||
response.setObjectNo(estimateRequest.getObjectNo());
|
response.setObjectNo(estimateRequest.getObjectNo());
|
||||||
response.setPlanNo(estimateRequest.getPlanNo());
|
response.setPlanNo(estimateRequest.getPlanNo());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 견적서 잠금처리
|
||||||
|
*
|
||||||
|
* @param estimateRequest
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void updateEstimateLock(EstimateRequest estimateRequest) throws Exception {
|
||||||
|
// Validation
|
||||||
|
if (StringUtils.isEmpty(estimateRequest.getObjectNo())) {
|
||||||
|
throw new QcastException(
|
||||||
|
ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "Object No"));
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(estimateRequest.getPlanNo())) {
|
||||||
|
throw new QcastException(
|
||||||
|
ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "Plan No"));
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(estimateRequest.getLockFlg())) {
|
||||||
|
throw new QcastException(
|
||||||
|
ErrorCode.INVALID_INPUT_VALUE,
|
||||||
|
message.getMessage("common.message.required.data", "Lock Flag"));
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
estimateMapper.updateEstimateLock(estimateRequest);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 견적서 엑셀 다운로드
|
* 견적서 엑셀 다운로드
|
||||||
*
|
*
|
||||||
@ -1218,6 +1249,10 @@ public class EstimateService {
|
|||||||
estimateResponse.setCustOmit("様邸");
|
estimateResponse.setCustOmit("様邸");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 견적서 잠금 처리
|
||||||
|
estimateRequest.setLockFlg("1");
|
||||||
|
estimateMapper.updateEstimateLock(estimateRequest);
|
||||||
|
|
||||||
// 견적서 특이사항 조회
|
// 견적서 특이사항 조회
|
||||||
List<NoteResponse> noteList = new ArrayList<NoteResponse>();
|
List<NoteResponse> noteList = new ArrayList<NoteResponse>();
|
||||||
if (!StringUtils.isEmpty(estimateResponse.getEstimateOption())) {
|
if (!StringUtils.isEmpty(estimateResponse.getEstimateOption())) {
|
||||||
|
|||||||
@ -157,6 +157,9 @@ public class EstimateRequest {
|
|||||||
@Schema(description = "QSP 동기화 여부")
|
@Schema(description = "QSP 동기화 여부")
|
||||||
private String syncFlg;
|
private String syncFlg;
|
||||||
|
|
||||||
|
@Schema(description = "잠금 여부")
|
||||||
|
private String lockFlg;
|
||||||
|
|
||||||
@Schema(description = "임시저장 여부")
|
@Schema(description = "임시저장 여부")
|
||||||
private String tempFlg;
|
private String tempFlg;
|
||||||
|
|
||||||
|
|||||||
@ -143,12 +143,15 @@ public class EstimateResponse {
|
|||||||
@Schema(description = "가격코드")
|
@Schema(description = "가격코드")
|
||||||
private String priceCd;
|
private String priceCd;
|
||||||
|
|
||||||
@Schema(description = "비고")
|
@Schema(description = "잠금 여부")
|
||||||
private String remarks;
|
private String lockFlg;
|
||||||
|
|
||||||
@Schema(description = "임시저장 여부")
|
@Schema(description = "임시저장 여부")
|
||||||
private String tempFlg;
|
private String tempFlg;
|
||||||
|
|
||||||
|
@Schema(description = "비고")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
@Schema(description = "갱신일")
|
@Schema(description = "갱신일")
|
||||||
private String lastEditDatetime;
|
private String lastEditDatetime;
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
, P.PKG_ASP
|
, P.PKG_ASP
|
||||||
, P.PRICE_CD
|
, P.PRICE_CD
|
||||||
, P.REMARKS
|
, P.REMARKS
|
||||||
|
, P.LOCK_FLG
|
||||||
, P.TEMP_FLG
|
, P.TEMP_FLG
|
||||||
, P.LAST_EDIT_DATETIME
|
, P.LAST_EDIT_DATETIME
|
||||||
, P.CREATE_DATETIME
|
, P.CREATE_DATETIME
|
||||||
@ -655,7 +656,6 @@
|
|||||||
UPDATE T_PLAN
|
UPDATE T_PLAN
|
||||||
SET
|
SET
|
||||||
ESTIMATE_TYPE = #{estimateType}
|
ESTIMATE_TYPE = #{estimateType}
|
||||||
, CHARGER = NULL
|
|
||||||
, FILE_FLG = '0'
|
, FILE_FLG = '0'
|
||||||
, ESTIMATE_OPTION = #{estimateOption}
|
, ESTIMATE_OPTION = #{estimateOption}
|
||||||
, REMARKS = NULL
|
, REMARKS = NULL
|
||||||
@ -671,6 +671,17 @@
|
|||||||
AND PLAN_NO = #{planNo}
|
AND PLAN_NO = #{planNo}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateEstimateLock" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
|
||||||
|
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateLock */
|
||||||
|
UPDATE T_PLAN
|
||||||
|
SET
|
||||||
|
LOCK_FLG = #{lockFlg}
|
||||||
|
, LAST_EDIT_DATETIME = GETDATE()
|
||||||
|
, LAST_EDIT_USER = #{userId}
|
||||||
|
WHERE OBJECT_NO = #{objectNo}
|
||||||
|
AND PLAN_NO = #{planNo}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updateEstimateApi" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
|
<update id="updateEstimateApi" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest">
|
||||||
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateApi */
|
/* sqlid : com.interplug.qcast.biz.estimate.updateEstimateApi */
|
||||||
UPDATE T_PLAN
|
UPDATE T_PLAN
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user