물건정보 삭제 시 QSP 설계의뢰 물건번호 초기화 처리
This commit is contained in:
parent
31d216f03c
commit
77ea9441f6
@ -10,7 +10,9 @@ import com.interplug.qcast.biz.object.dto.ObjectResponse;
|
||||
import com.interplug.qcast.biz.object.dto.PlanRequest;
|
||||
import com.interplug.qcast.biz.object.dto.PlanResponse;
|
||||
import com.interplug.qcast.biz.pwrGnrSimulation.PwrGnrSimService;
|
||||
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimGuideResponse;
|
||||
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimRequest;
|
||||
import com.interplug.qcast.biz.pwrGnrSimulation.dto.PwrGnrSimResponse;
|
||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||
import com.interplug.qcast.config.Exception.QcastException;
|
||||
import com.interplug.qcast.config.message.Messages;
|
||||
@ -763,7 +765,7 @@ public class EstimateService {
|
||||
PwrGnrSimRequest pwrGnrSimRequest = new PwrGnrSimRequest();
|
||||
pwrGnrSimRequest.setObjectNo(estimateResponse.getObjectNo());
|
||||
pwrGnrSimRequest.setPlanNo(estimateResponse.getPlanNo());
|
||||
/*
|
||||
|
||||
PwrGnrSimResponse pwrGnrSimResponse =
|
||||
pwrGnrSimService.selectPwrGnrSimulation(pwrGnrSimRequest);
|
||||
if (pwrGnrSimResponse != null) {
|
||||
@ -781,7 +783,6 @@ public class EstimateService {
|
||||
}
|
||||
|
||||
estimateResponse.setPwrGnrSim(pwrGnrSimResponse);
|
||||
*/
|
||||
|
||||
excelUtil.download(
|
||||
request,
|
||||
|
||||
@ -337,8 +337,41 @@ public class ObjectService {
|
||||
message.getMessage("common.message.required.data", "Object No"));
|
||||
}
|
||||
|
||||
// 물건정보 삭제
|
||||
result = objectMapper.deleteObject(objectRequest);
|
||||
// object 상세 정보 조회
|
||||
ObjectResponse objectResponse = objectMapper.selectObjectDetail(objectRequest.getObjectNo());
|
||||
if (objectResponse != null) {
|
||||
// 설계의뢰 번호가 존재하고 물건정보에 견적서가 없을 경우 QSP 설계의뢰 물건번호 초기화
|
||||
if (!StringUtils.isEmpty(objectResponse.getPlanReqNo())
|
||||
&& objectResponse.getEstimateTotCnt() == 0) {
|
||||
PlanReqResponse response = null;
|
||||
|
||||
PlanReqRequest planReqRequest = new PlanReqRequest();
|
||||
planReqRequest.setSaleStoreId(objectResponse.getSaleStoreId());
|
||||
planReqRequest.setSaleStoreLevel(objectResponse.getSaleStoreLevel());
|
||||
planReqRequest.setObjectNo(objectResponse.getObjectNo());
|
||||
planReqRequest.setPlanReqNo(objectResponse.getPlanReqNo());
|
||||
planReqRequest.setDelFlg("1");
|
||||
|
||||
String strResponse =
|
||||
interfaceQsp.callApi(
|
||||
HttpMethod.POST, QSP_API_URL + "/api/planReq/updateObjectNo", planReqRequest);
|
||||
if (!"".equals(strResponse)) {
|
||||
com.fasterxml.jackson.databind.ObjectMapper om =
|
||||
new com.fasterxml.jackson.databind.ObjectMapper()
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
response = om.readValue(strResponse, PlanReqResponse.class);
|
||||
|
||||
Map<String, Object> map = (Map<String, Object>) response.getResult();
|
||||
if ("E".equals(String.valueOf(map.get("resultCode")))) {
|
||||
throw new QcastException(
|
||||
ErrorCode.INTERNAL_SERVER_ERROR, String.valueOf(map.get("resultMsg")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 물건정보 삭제
|
||||
result = objectMapper.deleteObject(objectRequest);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -125,6 +125,9 @@ public class ObjectResponse {
|
||||
@Schema(description = "플랜 전체 건수")
|
||||
private String planTotCnt;
|
||||
|
||||
@Schema(description = "견적서 전체 건수")
|
||||
private Integer estimateTotCnt;
|
||||
|
||||
// 플랜목록
|
||||
@Schema(description = "플랜목록")
|
||||
private List<PlanResponse> planList;
|
||||
|
||||
@ -17,6 +17,9 @@ public class PlanReqRequest {
|
||||
@Schema(description = "물건번호")
|
||||
private String objectNo;
|
||||
|
||||
@Schema(description = "삭제여부")
|
||||
private String delFlg;
|
||||
|
||||
@Schema(description = "검색 - 설계의뢰번호")
|
||||
private String schPlanReqNo;
|
||||
|
||||
|
||||
@ -307,6 +307,7 @@
|
||||
, S.SALE_STORE_LEVEL
|
||||
, ISNULL(P.PREF_NAME, '') AS PREF_NAME
|
||||
, ISNULL(PA.AREA_NAME, '') AS AREA_NAME
|
||||
, (SELECT COUNT(1) FROM T_PLAN WHERE OBJECT_NO = O.OBJECT_NO AND DEL_FLG = '0' AND DRAWING_ESTIMATE_CREATE_DATE IS NOT NULL) AS ESTIMATE_TOT_CNT
|
||||
FROM T_OBJECT O WITH (NOLOCK)
|
||||
INNER JOIN M_SALES_STORE S WITH(NOLOCK)
|
||||
ON O.SALE_STORE_ID = S.SALE_STORE_ID
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user