From 77ea9441f68d759aa5c4ae7ff1f33407a18af3e0 Mon Sep 17 00:00:00 2001 From: "LAPTOP-L3VE7KK2\\USER" Date: Wed, 13 Nov 2024 15:58:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EC=8B=9C=20QSP=20=EC=84=A4=EA=B3=84?= =?UTF-8?q?=EC=9D=98=EB=A2=B0=20=EB=AC=BC=EA=B1=B4=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qcast/biz/estimate/EstimateService.java | 5 ++- .../qcast/biz/object/ObjectService.java | 37 ++++++++++++++++++- .../qcast/biz/object/dto/ObjectResponse.java | 3 ++ .../qcast/biz/object/dto/PlanReqRequest.java | 3 ++ .../resources/mappers/object/objectMapper.xml | 1 + 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java index 55a51206..8e813283 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -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, diff --git a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java index bc28e492..a0e9e5b5 100644 --- a/src/main/java/com/interplug/qcast/biz/object/ObjectService.java +++ b/src/main/java/com/interplug/qcast/biz/object/ObjectService.java @@ -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 map = (Map) 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; } diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java b/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java index 072cd47c..a786e460 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/ObjectResponse.java @@ -125,6 +125,9 @@ public class ObjectResponse { @Schema(description = "플랜 전체 건수") private String planTotCnt; + @Schema(description = "견적서 전체 건수") + private Integer estimateTotCnt; + // 플랜목록 @Schema(description = "플랜목록") private List planList; diff --git a/src/main/java/com/interplug/qcast/biz/object/dto/PlanReqRequest.java b/src/main/java/com/interplug/qcast/biz/object/dto/PlanReqRequest.java index a1aa3cd6..7898141c 100644 --- a/src/main/java/com/interplug/qcast/biz/object/dto/PlanReqRequest.java +++ b/src/main/java/com/interplug/qcast/biz/object/dto/PlanReqRequest.java @@ -17,6 +17,9 @@ public class PlanReqRequest { @Schema(description = "물건번호") private String objectNo; + @Schema(description = "삭제여부") + private String delFlg; + @Schema(description = "검색 - 설계의뢰번호") private String schPlanReqNo; diff --git a/src/main/resources/mappers/object/objectMapper.xml b/src/main/resources/mappers/object/objectMapper.xml index 783dc630..3d890072 100644 --- a/src/main/resources/mappers/object/objectMapper.xml +++ b/src/main/resources/mappers/object/objectMapper.xml @@ -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