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 bad195d4..20d63b8a 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,6 @@ import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; -import java.security.cert.X509Certificate; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -73,7 +72,6 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; - @Slf4j @Service @RequiredArgsConstructor @@ -115,32 +113,32 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(priceRequest.getSaleStoreId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Sale Store ID")); + message.getMessage("common.message.required.data", "Sale Store ID")); } if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Sap Sale Store Code")); + message.getMessage("common.message.required.data", "Sap Sale Store Code")); } if (StringUtils.isEmpty(priceRequest.getDocTpCd())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Estimate Type")); + message.getMessage("common.message.required.data", "Estimate Type")); } EstimateApiResponse response = null; /* [1]. QSP API (url + param) Setting */ String url = QSP_API_URL + "/api/price/storePriceList"; String apiUrl = UriComponentsBuilder.fromHttpUrl(url) - .queryParam("saleStoreId", priceRequest.getSaleStoreId()) - .queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd()) - .queryParam("docTpCd", priceRequest.getDocTpCd()).build().toUriString(); + .queryParam("saleStoreId", priceRequest.getSaleStoreId()) + .queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd()) + .queryParam("docTpCd", priceRequest.getDocTpCd()).build().toUriString(); /* [2]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); if (!"".equals(strResponse)) { com.fasterxml.jackson.databind.ObjectMapper om = - new com.fasterxml.jackson.databind.ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + new com.fasterxml.jackson.databind.ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); response = om.readValue(strResponse, EstimateApiResponse.class); } else { // [msg] No data @@ -161,26 +159,26 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(priceRequest.getSaleStoreId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Sale Store ID")); + message.getMessage("common.message.required.data", "Sale Store ID")); } if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Sap Sale Store Code")); + message.getMessage("common.message.required.data", "Sap Sale Store Code")); } if (StringUtils.isEmpty(priceRequest.getPriceCd())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Price Code")); + message.getMessage("common.message.required.data", "Price Code")); } EstimateApiResponse response = null; /* [1]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.POST, - QSP_API_URL + "/api//price/storePriceItemList", priceRequest); + QSP_API_URL + "/api//price/storePriceItemList", priceRequest); if (!"".equals(strResponse)) { com.fasterxml.jackson.databind.ObjectMapper om = - new com.fasterxml.jackson.databind.ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + new com.fasterxml.jackson.databind.ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); response = om.readValue(strResponse, EstimateApiResponse.class); } else { // [msg] No data @@ -224,11 +222,11 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(objectNo)) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Object No")); + message.getMessage("common.message.required.data", "Object No")); } if (StringUtils.isEmpty(planNo)) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Plan No")); + message.getMessage("common.message.required.data", "Plan No")); } String splitStr = "、"; @@ -251,26 +249,26 @@ public class EstimateService { String orgConstructSpecificationMultis = response.getConstructSpecificationMulti(); if (!StringUtils.isEmpty(orgRoofMaterialIdMultis) - && !StringUtils.isEmpty(orgConstructSpecificationMultis)) { + && !StringUtils.isEmpty(orgConstructSpecificationMultis)) { String[] arrOrgRoofMaterialIdMultis = orgRoofMaterialIdMultis.split(splitStr); String[] arrOrgConstructSpecificationMultis = - orgConstructSpecificationMultis.split(splitStr); + orgConstructSpecificationMultis.split(splitStr); if (arrOrgRoofMaterialIdMultis.length == arrOrgConstructSpecificationMultis.length) { for (int i = 0; i < arrOrgRoofMaterialIdMultis.length; i++) { if (!roofCheckDatas.contains( - arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i])) { + arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i])) { roofMaterialIdMultis += - StringUtils.isEmpty(roofMaterialIdMultis) ? arrOrgRoofMaterialIdMultis[i] - : splitStr + arrOrgRoofMaterialIdMultis[i]; + StringUtils.isEmpty(roofMaterialIdMultis) ? arrOrgRoofMaterialIdMultis[i] + : splitStr + arrOrgRoofMaterialIdMultis[i]; constructSpecificationMultis += StringUtils.isEmpty(constructSpecificationMultis) - ? arrOrgConstructSpecificationMultis[i] - : splitStr + arrOrgConstructSpecificationMultis[i]; + ? arrOrgConstructSpecificationMultis[i] + : splitStr + arrOrgConstructSpecificationMultis[i]; } roofCheckDatas += - arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i]; + arrOrgRoofMaterialIdMultis[i] + "_" + arrOrgConstructSpecificationMultis[i]; } if (!StringUtils.isEmpty(roofMaterialIdMultis)) { @@ -312,19 +310,19 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(estimateRequest.getObjectNo())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Object No")); + 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")); + message.getMessage("common.message.required.data", "Plan No")); } if (StringUtils.isEmpty(estimateRequest.getSaleStoreId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Sale Store ID")); + message.getMessage("common.message.required.data", "Sale Store ID")); } if (StringUtils.isEmpty(estimateRequest.getUserId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "User ID")); + message.getMessage("common.message.required.data", "User ID")); } String splitStr = "、"; @@ -347,10 +345,10 @@ public class EstimateService { // 물건정보 조회 후 데이터 축출 ObjectResponse objectResponse = - objectMapper.selectObjectDetail(estimateRequest.getObjectNo()); + objectMapper.selectObjectDetail(estimateRequest.getObjectNo()); if (objectResponse != null) { estimateRequest - .setWeatherPoint(objectResponse.getPrefName() + " - " + objectResponse.getAreaName()); + .setWeatherPoint(objectResponse.getPrefName() + " - " + objectResponse.getAreaName()); estimateRequest.setCharger(objectResponse.getReceiveUser()); } @@ -389,7 +387,7 @@ public class EstimateService { if (!StringUtils.isEmpty(roofRequest.getConstructSpecification())) { constructSpecifications += - !StringUtils.isEmpty(constructSpecifications) ? splitStr : ""; + !StringUtils.isEmpty(constructSpecifications) ? splitStr : ""; constructSpecifications += roofRequest.getConstructSpecification(); } @@ -405,7 +403,7 @@ public class EstimateService { if (!StringUtils.isEmpty(roofRequest.getConstructSpecificationMulti())) { constructSpecificationMultis += - !StringUtils.isEmpty(constructSpecificationMultis) ? splitStr : ""; + !StringUtils.isEmpty(constructSpecificationMultis) ? splitStr : ""; constructSpecificationMultis += roofRequest.getConstructSpecificationMulti(); } @@ -466,7 +464,7 @@ public class EstimateService { // 아이템 BOM Header인 경우 컴포넌트 등록 처리 if ("ERLA".equals(itemRequest.getItemCtgGr())) { List itemBomList = - estimateMapper.selectItemMasterBomList(itemRequest.getItemId()); + estimateMapper.selectItemMasterBomList(itemRequest.getItemId()); int k = 1; for (ItemResponse itemResponse : itemBomList) { @@ -481,7 +479,7 @@ public class EstimateService { bomItem.setPnowW(itemResponse.getPnowW()); bomItem.setSpecification(itemResponse.getPnowW()); bomItem.setAmount(String.valueOf(Integer.parseInt(itemResponse.getBomAmount()) - * Integer.parseInt(itemRequest.getAmount()))); + * Integer.parseInt(itemRequest.getAmount()))); bomItem.setBomAmount(itemResponse.getBomAmount()); bomItem.setUnitPrice(itemResponse.getSalePrice()); bomItem.setSalePrice(itemResponse.getSalePrice()); @@ -524,16 +522,16 @@ public class EstimateService { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR003"; // 출력제어시간 기본 체크 } else if ("ATTR004".equals(noteResponse.getCode()) - && "1".equals(estimateRequest.getNorthArrangement())) { + && "1".equals(estimateRequest.getNorthArrangement())) { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR004"; // 북면설치 체크 } else if ("ATTR005".equals(noteResponse.getCode()) - && "1".equals(objectResponse != null ? objectResponse.getSaltAreaFlg() : "")) { + && "1".equals(objectResponse != null ? objectResponse.getSaltAreaFlg() : "")) { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR005"; // 염해지역 체크 } else if ("ATTR006" - .equals(objectResponse != null ? objectResponse.getColdRegionFlg() : "") - && "1".equals(estimateRequest.getNorthArrangement())) { + .equals(objectResponse != null ? objectResponse.getColdRegionFlg() : "") + && "1".equals(estimateRequest.getNorthArrangement())) { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR006"; // 적설지역 체크 } else if ("ATTR007".equals(noteResponse.getCode())) { @@ -583,23 +581,23 @@ public class EstimateService { if (!"1".equals(itemRequest.getDelFlg())) { if (StringUtils.isEmpty(itemRequest.getDispOrder())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Display Order")); + message.getMessage("common.message.required.data", "Display Order")); } if (StringUtils.isEmpty(itemRequest.getItemId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Item ID")); + message.getMessage("common.message.required.data", "Item ID")); } if (StringUtils.isEmpty(itemRequest.getAmount())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Item Amount")); + message.getMessage("common.message.required.data", "Item Amount")); } // 수량 BigDecimal amount = new BigDecimal( - StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount()); + StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount()); // 아이템용량 BigDecimal pnowW = new BigDecimal( - StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW()); + StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW()); // 모듈/PC 체크 if ("MODULE_".equals(itemRequest.getItemGroup())) { @@ -619,20 +617,20 @@ public class EstimateService { // 물건정보 수정 if (!StringUtils.isEmpty(estimateRequest.getObjectName()) - || !StringUtils.isEmpty(estimateRequest.getObjectNameOmit())) { + || !StringUtils.isEmpty(estimateRequest.getObjectNameOmit())) { estimateMapper.updateObject(estimateRequest); } if (!StringUtils.isEmpty(estimateRequest.getSurfaceType()) - || !StringUtils.isEmpty(estimateRequest.getSetupHeight()) - || !StringUtils.isEmpty(estimateRequest.getStandardWindSpeedId()) - || !StringUtils.isEmpty(estimateRequest.getSnowfall())) { + || !StringUtils.isEmpty(estimateRequest.getSetupHeight()) + || !StringUtils.isEmpty(estimateRequest.getStandardWindSpeedId()) + || !StringUtils.isEmpty(estimateRequest.getSnowfall())) { estimateMapper.updateObjectInfo(estimateRequest); } // 견적서 정보 수정 estimateRequest.setPriceCd( - !StringUtils.isEmpty(estimateRequest.getPriceCd()) ? estimateRequest.getPriceCd() - : "UNIT_PRICE"); + !StringUtils.isEmpty(estimateRequest.getPriceCd()) ? estimateRequest.getPriceCd() + : "UNIT_PRICE"); estimateMapper.updateEstimate(estimateRequest); estimateMapper.updateEstimateInfo(estimateRequest); @@ -660,9 +658,9 @@ public class EstimateService { boolean overLap = false; for (ItemRequest data : roofItemList) { if (itemRequest.getItemId().equals(data.getItemId()) - && itemRequest.getPcItemId().equals(data.getPcItemId())) { + && itemRequest.getPcItemId().equals(data.getPcItemId())) { data.setAmount(String.valueOf(Integer.parseInt(data.getAmount()) + 1)); // 데이터 존재하면 - // 카운팅 + 1 + // 카운팅 + 1 overLap = true; break; } @@ -687,7 +685,7 @@ public class EstimateService { // 견적서 PCS 아이템 회로 구성 List circuitPcsItemList = - this.getPcsCircuitList(circuitItemList, allModuleList); + this.getPcsCircuitList(circuitItemList, allModuleList); // 견적서 회로구성 아이템 신규 추가 for (ItemRequest circuitItemRequest : circuitPcsItemList) { @@ -706,7 +704,7 @@ public class EstimateService { itemRequest.setObjectNo(estimateRequest.getObjectNo()); itemRequest.setPlanNo(estimateRequest.getPlanNo()); itemRequest.setAmount( - !StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0"); + !StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0"); itemRequest.setUserId(estimateRequest.getUserId()); // BOM 컴포넌트는 제외하고 등록 @@ -727,23 +725,23 @@ public class EstimateService { itemRequest.setObjectNo(estimateRequest.getObjectNo()); itemRequest.setPlanNo(estimateRequest.getPlanNo()); itemRequest.setAmount( - !StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0"); + !StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0"); itemRequest.setSalePrice( - !StringUtils.isEmpty(itemRequest.getSalePrice()) ? itemRequest.getSalePrice() : "0"); + !StringUtils.isEmpty(itemRequest.getSalePrice()) ? itemRequest.getSalePrice() : "0"); itemRequest.setBomAmount( - !StringUtils.isEmpty(itemRequest.getBomAmount()) ? itemRequest.getBomAmount() : "0"); + !StringUtils.isEmpty(itemRequest.getBomAmount()) ? itemRequest.getBomAmount() : "0"); itemRequest.setPartAdd( - !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); + !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); itemRequest.setOpenFlg( - !StringUtils.isEmpty(itemRequest.getOpenFlg()) ? itemRequest.getOpenFlg() : "0"); + !StringUtils.isEmpty(itemRequest.getOpenFlg()) ? itemRequest.getOpenFlg() : "0"); itemRequest.setUnitOpenFlg( !StringUtils.isEmpty(itemRequest.getUnitOpenFlg()) ? itemRequest.getUnitOpenFlg() : "0"); itemRequest.setItemChangeFlg( - !StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() - : "0"); + !StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() + : "0"); itemRequest.setDispCableFlg( - !StringUtils.isEmpty(itemRequest.getDispCableFlg()) ? itemRequest.getDispCableFlg() - : "0"); + !StringUtils.isEmpty(itemRequest.getDispCableFlg()) ? itemRequest.getDispCableFlg() + : "0"); itemRequest.setUserId(estimateRequest.getUserId()); estimateMapper.insertEstimateItemHis(itemRequest); @@ -800,19 +798,19 @@ public class EstimateService { * @throws Exception */ public EstimateResponse insertEstimateCopy(EstimateCopyRequest estimateCopyRequest) - throws Exception { + throws Exception { // Validation if (StringUtils.isEmpty(estimateCopyRequest.getObjectNo())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Object No")); + message.getMessage("common.message.required.data", "Object No")); } if (StringUtils.isEmpty(estimateCopyRequest.getPlanNo())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Plan No")); + message.getMessage("common.message.required.data", "Plan No")); } if (StringUtils.isEmpty(estimateCopyRequest.getUserId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "User ID")); + message.getMessage("common.message.required.data", "User ID")); } // 응답 객체 @@ -823,7 +821,7 @@ public class EstimateService { ObjectRequest objectRequest = new ObjectRequest(); objectRequest.setSaleStoreId(estimateCopyRequest.getCopySaleStoreId()); objectRequest - .setReceiveUser(StringUtils.defaultString(estimateCopyRequest.getCopyReceiveUser())); + .setReceiveUser(StringUtils.defaultString(estimateCopyRequest.getCopyReceiveUser())); objectRequest.setDelFlg("1"); objectRequest.setOrgDelFlg("0"); objectRequest.setTempFlg("0"); @@ -909,10 +907,10 @@ public class EstimateService { itemRequest.setObjectNo(estimateCopyRequest.getCopyObjectNo()); itemRequest.setPlanNo(estimateCopyRequest.getCopyPlanNo()); itemRequest.setPartAdd( - !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); + !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); itemRequest.setItemChangeFlg( - !StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() - : "0"); + !StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() + : "0"); itemRequest.setUserId(estimateCopyRequest.getUserId()); estimateMapper.insertEstimateItem(itemRequest); @@ -959,22 +957,22 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(estimateRequest.getObjectNo())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Object No")); + 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")); + message.getMessage("common.message.required.data", "Plan No")); } if (StringUtils.isEmpty(estimateRequest.getUserId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "User ID")); + message.getMessage("common.message.required.data", "User ID")); } // 견적서 상세 조회 EstimateResponse estimateResponse = estimateMapper.selectEstimateDetail(estimateRequest); if (estimateResponse == null) { throw new QcastException(ErrorCode.NOT_FOUND, - message.getMessage("common.message.required.data", "Estimate Info")); + message.getMessage("common.message.required.data", "Estimate Info")); } // 응답 객체 @@ -989,16 +987,16 @@ public class EstimateService { // 물건정보 조회 후 데이터 축출 ObjectResponse objectResponse = - objectMapper.selectObjectDetail(estimateRequest.getObjectNo()); + objectMapper.selectObjectDetail(estimateRequest.getObjectNo()); if (objectResponse != null) { estimateRequest - .setWeatherPoint(objectResponse.getPrefName() + " - " + objectResponse.getAreaName()); + .setWeatherPoint(objectResponse.getPrefName() + " - " + objectResponse.getAreaName()); estimateRequest.setCharger(objectResponse.getReceiveUser()); } // [2] 도면에서 저장된 아이템 목록 조회 List estimateItemList = - estimateMapper.selectEstimateDrawingItemList(estimateRequest); + estimateMapper.selectEstimateDrawingItemList(estimateRequest); List itemList = new ArrayList(); for (ItemResponse itemResponse : estimateItemList) { ItemRequest itemRequest = new ItemRequest(); @@ -1052,7 +1050,7 @@ public class EstimateService { // 아이템 BOM Header인 경우 컴포넌트 등록 처리 if ("ERLA".equals(itemRequest.getItemCtgGr())) { List itemBomList = - estimateMapper.selectItemMasterBomList(itemRequest.getItemId()); + estimateMapper.selectItemMasterBomList(itemRequest.getItemId()); int k = 1; for (ItemResponse itemResponse : itemBomList) { @@ -1067,7 +1065,7 @@ public class EstimateService { bomItem.setPnowW(itemResponse.getPnowW()); bomItem.setSpecification(itemResponse.getPnowW()); bomItem.setAmount(String.valueOf(Integer.parseInt(itemResponse.getBomAmount()) - * Integer.parseInt(itemRequest.getAmount()))); + * Integer.parseInt(itemRequest.getAmount()))); bomItem.setBomAmount(itemResponse.getBomAmount()); bomItem.setUnitPrice(itemResponse.getSalePrice()); bomItem.setSalePrice(itemResponse.getSalePrice()); @@ -1110,15 +1108,15 @@ public class EstimateService { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR003"; // 출력제어시간 기본 체크 } else if ("ATTR004".equals(noteResponse.getCode()) - && "1".equals(estimateRequest.getNorthArrangement())) { + && "1".equals(estimateRequest.getNorthArrangement())) { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR004"; // 북면설치 체크 } else if ("ATTR005".equals(noteResponse.getCode()) - && "1".equals(objectResponse != null ? objectResponse.getSaltAreaFlg() : "")) { + && "1".equals(objectResponse != null ? objectResponse.getSaltAreaFlg() : "")) { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR005"; // 염해지역 체크 } else if ("ATTR006".equals(objectResponse != null ? objectResponse.getColdRegionFlg() : "") - && "1".equals(estimateRequest.getNorthArrangement())) { + && "1".equals(estimateRequest.getNorthArrangement())) { estimateOptions += !StringUtils.isEmpty(estimateOptions) ? splitStr : ""; estimateOptions += "ATTR006"; // 적설지역 체크 } else if ("ATTR007".equals(noteResponse.getCode())) { @@ -1166,23 +1164,23 @@ public class EstimateService { for (ItemRequest itemRequest : itemList) { if (StringUtils.isEmpty(itemRequest.getDispOrder())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Display Order")); + message.getMessage("common.message.required.data", "Display Order")); } if (StringUtils.isEmpty(itemRequest.getItemId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Item ID")); + message.getMessage("common.message.required.data", "Item ID")); } if (StringUtils.isEmpty(itemRequest.getAmount())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Item Amount")); + message.getMessage("common.message.required.data", "Item Amount")); } // 수량 BigDecimal amount = new BigDecimal( - StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount()); + StringUtils.isEmpty(itemRequest.getAmount()) ? "0" : itemRequest.getAmount()); // 아이템용량 BigDecimal pnowW = new BigDecimal( - StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW()); + StringUtils.isEmpty(itemRequest.getPnowW()) ? "0" : itemRequest.getPnowW()); // 모듈/PC 체크 if ("MODULE_".equals(itemRequest.getItemGroup())) { @@ -1213,20 +1211,20 @@ public class EstimateService { itemRequest.setObjectNo(estimateRequest.getObjectNo()); itemRequest.setPlanNo(estimateRequest.getPlanNo()); itemRequest.setAmount( - !StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0"); + !StringUtils.isEmpty(itemRequest.getAmount()) ? itemRequest.getAmount() : "0"); itemRequest.setSalePrice( - !StringUtils.isEmpty(itemRequest.getSalePrice()) ? itemRequest.getSalePrice() : "0"); + !StringUtils.isEmpty(itemRequest.getSalePrice()) ? itemRequest.getSalePrice() : "0"); itemRequest.setBomAmount( - !StringUtils.isEmpty(itemRequest.getBomAmount()) ? itemRequest.getBomAmount() : "0"); + !StringUtils.isEmpty(itemRequest.getBomAmount()) ? itemRequest.getBomAmount() : "0"); itemRequest.setPartAdd( - !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); + !StringUtils.isEmpty(itemRequest.getPartAdd()) ? itemRequest.getPartAdd() : "0"); itemRequest.setOpenFlg( - !StringUtils.isEmpty(itemRequest.getOpenFlg()) ? itemRequest.getOpenFlg() : "0"); + !StringUtils.isEmpty(itemRequest.getOpenFlg()) ? itemRequest.getOpenFlg() : "0"); itemRequest.setUnitOpenFlg( !StringUtils.isEmpty(itemRequest.getUnitOpenFlg()) ? itemRequest.getUnitOpenFlg() : "0"); itemRequest.setItemChangeFlg( - !StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() - : "0"); + !StringUtils.isEmpty(itemRequest.getItemChangeFlg()) ? itemRequest.getItemChangeFlg() + : "0"); itemRequest.setUserId(estimateRequest.getUserId()); estimateMapper.insertEstimateItemHis(itemRequest); @@ -1273,19 +1271,19 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(estimateRequest.getObjectNo())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Object No")); + 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")); + 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")); + message.getMessage("common.message.required.data", "Lock Flag")); } if (StringUtils.isEmpty(estimateRequest.getUserId())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "User ID")); + message.getMessage("common.message.required.data", "User ID")); } try { @@ -1305,7 +1303,7 @@ public class EstimateService { * @throws Exception */ public void excelDownload(HttpServletRequest request, HttpServletResponse response, - EstimateRequest estimateRequest) throws Exception { + EstimateRequest estimateRequest) throws Exception { EstimateResponse estimateResponse = new EstimateResponse(); String splitStr = "、"; @@ -1313,11 +1311,11 @@ public class EstimateService { // Validation if (StringUtils.isEmpty(estimateRequest.getObjectNo())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Object No")); + 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")); + message.getMessage("common.message.required.data", "Plan No")); } try { @@ -1327,7 +1325,7 @@ public class EstimateService { // file Name 명이 없는경우 if (estimateRequest.getFileName() == null || "".equals(estimateRequest.getFileName())) { estimateRequest.setFileName(estimateResponse.getObjectNo() + "_" - + new SimpleDateFormat("yyyyMMdd").format(new Date())); + + new SimpleDateFormat("yyyyMMdd").format(new Date())); } if ("1".equals(estimateRequest.getSchDisplayFlg())) { @@ -1346,7 +1344,7 @@ public class EstimateService { List noteList = new ArrayList(); if (!StringUtils.isEmpty(estimateResponse.getEstimateOption())) { String[] arrSpnAttrCd = - new String[estimateResponse.getEstimateOption().split(splitStr).length]; + new String[estimateResponse.getEstimateOption().split(splitStr).length]; int i = 0; for (String str : estimateResponse.getEstimateOption().split(splitStr)) { arrSpnAttrCd[i++] = str; @@ -1363,7 +1361,7 @@ public class EstimateService { RoofInfoResponse roofInfoResponse = new RoofInfoResponse(); List roofList = estimateMapper.selectEstimateRoofList(estimateRequest); List circuitItemList = - estimateMapper.selectEstimateCircuitItemList(estimateRequest); + estimateMapper.selectEstimateCircuitItemList(estimateRequest); estimateRequest.setSchItemGroup("MODULE_"); List roofVolList = estimateMapper.selectEstimateRoofVolList(estimateRequest); @@ -1371,9 +1369,9 @@ public class EstimateService { BigDecimal moduleTotVolKw = BigDecimal.ZERO; for (RoofResponse roofVol : roofVolList) { BigDecimal amount = - new BigDecimal(StringUtils.isEmpty(roofVol.getAmount()) ? "0" : roofVol.getAmount()); + new BigDecimal(StringUtils.isEmpty(roofVol.getAmount()) ? "0" : roofVol.getAmount()); BigDecimal vol = - new BigDecimal(StringUtils.isEmpty(roofVol.getVolKw()) ? "0" : roofVol.getVolKw()); + new BigDecimal(StringUtils.isEmpty(roofVol.getVolKw()) ? "0" : roofVol.getVolKw()); String classTypeName = ""; if ("0".equals(roofVol.getClassType())) { @@ -1403,7 +1401,7 @@ public class EstimateService { // 총 합산금액 계산 this.selectTotalPriceInfo(estimateResponse, estimateItemList, - estimateRequest.getSchUnitPriceFlg()); + estimateRequest.getSchUnitPriceFlg()); int j = 1; for (ItemResponse itemResponse : estimateItemList) { @@ -1411,14 +1409,14 @@ public class EstimateService { // 문자열 통화로 변환 처리 itemResponse.setSalePrice( - String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice()))); + String.format("%1$,.0f", Double.parseDouble(itemResponse.getSalePrice()))); itemResponse - .setAmount(String.format("%1$,.0f", Double.parseDouble(itemResponse.getAmount()))); + .setAmount(String.format("%1$,.0f", Double.parseDouble(itemResponse.getAmount()))); itemResponse.setSaleTotPrice( - String.format("%1$,.0f", Double.parseDouble(itemResponse.getSaleTotPrice()))); + String.format("%1$,.0f", Double.parseDouble(itemResponse.getSaleTotPrice()))); if ("YJSS".equals(estimateResponse.getEstimateType()) - && (!StringUtils.isEmpty(itemResponse.getPaDispOrder()) + && (!StringUtils.isEmpty(itemResponse.getPaDispOrder()) || !"1".equals(itemResponse.getPkgMaterialFlg()))) { itemResponse.setSalePrice(""); itemResponse.setSaleTotPrice(""); @@ -1442,21 +1440,21 @@ public class EstimateService { // 합산 문자열 통화로 변환 처리 estimateResponse.setPkgYn("YJSS".equals(estimateResponse.getEstimateType()) ? "Y" : "N"); estimateResponse - .setPkgNo("YJSS".equals(estimateResponse.getEstimateType()) ? String.valueOf(j++) : ""); + .setPkgNo("YJSS".equals(estimateResponse.getEstimateType()) ? String.valueOf(j++) : ""); if ("YJSS".equals(estimateResponse.getEstimateType())) { estimateResponse - .setPkgAsp(String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgAsp()))); + .setPkgAsp(String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgAsp()))); } estimateResponse - .setTotVol(String.format("%1$,.0f", Double.parseDouble(estimateResponse.getTotVol()))); + .setTotVol(String.format("%1$,.0f", Double.parseDouble(estimateResponse.getTotVol()))); estimateResponse.setPkgTotPrice( - String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgTotPrice()))); + String.format("%1$,.0f", Double.parseDouble(estimateResponse.getPkgTotPrice()))); estimateResponse.setSupplyPrice( - String.format("%1$,.0f", Double.parseDouble(estimateResponse.getSupplyPrice()))); + String.format("%1$,.0f", Double.parseDouble(estimateResponse.getSupplyPrice()))); estimateResponse.setVatPrice( - String.format("%1$,.0f", Double.parseDouble(estimateResponse.getVatPrice()))); + String.format("%1$,.0f", Double.parseDouble(estimateResponse.getVatPrice()))); estimateResponse.setTotPrice( - String.format("%1$,.0f", Double.parseDouble(estimateResponse.getTotPrice()))); + String.format("%1$,.0f", Double.parseDouble(estimateResponse.getTotPrice()))); // 발전시뮬레이션 계산 PwrGnrSimRequest pwrGnrSimRequest = new PwrGnrSimRequest(); @@ -1464,7 +1462,7 @@ public class EstimateService { pwrGnrSimRequest.setPlanNo(estimateResponse.getPlanNo()); PwrGnrSimResponse pwrGnrSimResponse = - pwrGnrSimService.selectPwrGnrSimulation(pwrGnrSimRequest); + pwrGnrSimService.selectPwrGnrSimulation(pwrGnrSimRequest); pwrGnrSimResponse.setPwrGnrSimType(estimateRequest.getPwrGnrSimType()); // 발전시뮬레이션 타입에 따른 list 셋팅 @@ -1479,15 +1477,15 @@ public class EstimateService { } pwrGnrSimResponse.setIntFrcPwrGnrList( - Arrays.stream(pwrGnrSimResponse.getFrcPwrGnrList()).map(s -> s.replace(",", "")) // , 제거 - .mapToInt(Integer::parseInt) // 문자열을 int로 변환 - .toArray()); + Arrays.stream(pwrGnrSimResponse.getFrcPwrGnrList()).map(s -> s.replace(",", "")) // , 제거 + .mapToInt(Integer::parseInt) // 문자열을 int로 변환 + .toArray()); if (pwrGnrSimResponse != null) { try { // 발전시뮬레이션 안내사항 조회 PwrGnrSimGuideResponse pwrGnrSimGuideInfo = - pwrGnrSimService.selectPwrGnrSimulationGuideInfo(); + pwrGnrSimService.selectPwrGnrSimulationGuideInfo(); if (pwrGnrSimGuideInfo != null) { pwrGnrSimResponse.setGuideInfo(pwrGnrSimGuideInfo.getData()); } @@ -1497,18 +1495,12 @@ public class EstimateService { estimateResponse.setPwrGnrSim(pwrGnrSimResponse); - // 도면 이미지 셋팅 String baseDrawingImgName = estimateRequest.getObjectNo() + "_" + estimateRequest.getPlanNo(); URL url = new URL(drawingDirPath + File.separator + baseDrawingImgName + "_1.png"); URLConnection con = url.openConnection(); - HttpURLConnection exitCode = (HttpURLConnection) con; - - System.err.println("exitCode: " + exitCode); - System.err.println("Exit code: " + exitCode.getResponseCode()); - - + HttpURLConnection exitCode = (HttpURLConnection)con; if (exitCode.getResponseCode() == 200) { InputStream imageInputStream = new URL(drawingDirPath + File.separator + baseDrawingImgName + "_1.png").openStream(); @@ -1525,7 +1517,7 @@ public class EstimateService { String baseDrawingImgName2 = estimateRequest.getObjectNo() + "_" + estimateRequest.getPlanNo(); URL url2 = new URL(drawingDirPath + File.separator + baseDrawingImgName2 + "_2.png"); URLConnection con2 = url2.openConnection(); - HttpURLConnection exitCode2 = (HttpURLConnection) con2; + HttpURLConnection exitCode2 = (HttpURLConnection)con2; if (exitCode2.getResponseCode() == 200) { InputStream imageInputStream2 = new URL(drawingDirPath + File.separator + baseDrawingImgName2 + "_2.png").openStream(); @@ -1594,8 +1586,8 @@ public class EstimateService { ExcelUtil excelUtil = new ExcelUtil(); byte[] excelBytes = - excelUtil.download(request, response, excelUtil.convertVoToMap(estimateResponse), - excelUtil.convertListToMap(estimateItemList), excelTemplateNam); + excelUtil.download(request, response, excelUtil.convertVoToMap(estimateResponse), + excelUtil.convertListToMap(estimateItemList), excelTemplateNam); InputStream in = new ByteArrayInputStream(excelBytes); workbook = WorkbookFactory.create(in); // JXLS POI 엑셀로 재변환 @@ -1627,7 +1619,7 @@ public class EstimateService { excelBytes = byteArrayOutputStream.toByteArray(); response.setHeader("Content-Disposition", - "attachment; filename=\"" + estimateRequest.getFileName() + ".xlsx\""); + "attachment; filename=\"" + estimateRequest.getFileName() + ".xlsx\""); response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.getOutputStream().write(excelBytes); } @@ -1647,7 +1639,7 @@ public class EstimateService { * @throws Exception */ public void selectTotalPriceInfo(EstimateResponse estimateResponse, List itemList, - String unitPriceFlg) throws Exception { + String unitPriceFlg) throws Exception { BigDecimal totAmount = BigDecimal.ZERO; BigDecimal totVol = BigDecimal.ZERO; BigDecimal pkgTotPrice = BigDecimal.ZERO; @@ -1659,26 +1651,26 @@ public class EstimateService { // 주택패키지 단가 BigDecimal pkgAsp = new BigDecimal( - StringUtils.isEmpty(estimateResponse.getPkgAsp()) ? "0" : estimateResponse.getPkgAsp()); + StringUtils.isEmpty(estimateResponse.getPkgAsp()) ? "0" : estimateResponse.getPkgAsp()); for (ItemResponse itemResponse : itemList) { // 수량 BigDecimal amount = new BigDecimal( - StringUtils.isEmpty(itemResponse.getAmount()) ? "0" : itemResponse.getAmount()); + StringUtils.isEmpty(itemResponse.getAmount()) ? "0" : itemResponse.getAmount()); // 판매가 BigDecimal salePrice = BigDecimal.ZERO; if ("1".equals(unitPriceFlg)) { salePrice = new BigDecimal( - StringUtils.isEmpty(itemResponse.getUnitPrice()) ? "0" : itemResponse.getUnitPrice()); + StringUtils.isEmpty(itemResponse.getUnitPrice()) ? "0" : itemResponse.getUnitPrice()); itemResponse.setSalePrice(String.valueOf(salePrice)); } else { salePrice = new BigDecimal( - StringUtils.isEmpty(itemResponse.getSalePrice()) ? "0" : itemResponse.getSalePrice()); + StringUtils.isEmpty(itemResponse.getSalePrice()) ? "0" : itemResponse.getSalePrice()); } // 아이템용량 BigDecimal pnowW = new BigDecimal( - StringUtils.isEmpty(itemResponse.getPnowW()) ? "0" : itemResponse.getPnowW()); + StringUtils.isEmpty(itemResponse.getPnowW()) ? "0" : itemResponse.getPnowW()); // 아이템 단가 합산 itemResponse.setSaleTotPrice(String.valueOf(salePrice.multiply(amount))); @@ -1723,9 +1715,9 @@ public class EstimateService { estimateResponse.setTotAmount(String.valueOf(totAmount.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setTotVol(String.valueOf(totVol)); estimateResponse.setTotVolKw(String - .valueOf(totVol.multiply(new BigDecimal("0.001")).setScale(3, BigDecimal.ROUND_FLOOR))); + .valueOf(totVol.multiply(new BigDecimal("0.001")).setScale(3, BigDecimal.ROUND_FLOOR))); estimateResponse - .setSupplyPrice(String.valueOf(supplyPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); + .setSupplyPrice(String.valueOf(supplyPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setVatPrice(String.valueOf(vatPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); estimateResponse.setTotPrice(String.valueOf(totPrice.setScale(0, BigDecimal.ROUND_HALF_UP))); } @@ -1738,7 +1730,7 @@ public class EstimateService { * @throws Exception */ public List sendEstimateApi(EstimateRequest estimateRequest) - throws Exception { + throws Exception { EstimateSendRequest estimateSendRequest = new EstimateSendRequest(); List quoteList = new ArrayList(); String docNo = ""; @@ -1746,24 +1738,24 @@ public class EstimateService { try { // 견적서 상세 조회 EstimateSendResponse estimateSendResponse = - estimateMapper.selectEstimateApiDetail(estimateRequest); + estimateMapper.selectEstimateApiDetail(estimateRequest); if (estimateSendResponse == null) { throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data")); } else { String constructSpecification = - estimateMapper.selectEstimateConstructSpecification(estimateRequest); + estimateMapper.selectEstimateConstructSpecification(estimateRequest); estimateSendResponse.setSaveType("3"); estimateSendResponse.setSyncFlg("0"); estimateSendResponse.setConstructSpecification( - !StringUtils.isEmpty(constructSpecification) ? constructSpecification : ""); + !StringUtils.isEmpty(constructSpecification) ? constructSpecification : ""); estimateSendResponse.setDelFlg("1".equals(estimateSendResponse.getDelFlg()) ? "Y" : "N"); // 아이템 목록 조회 estimateRequest.setSchBomNotExist("1"); List estimateItemList = - estimateMapper.selectEstimateItemList(estimateRequest); + estimateMapper.selectEstimateItemList(estimateRequest); estimateSendResponse.setItemList(estimateItemList); // 첨부파일 목록 조회 @@ -1784,24 +1776,24 @@ public class EstimateService { EstimateApiResponse response = null; /* [1]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.POST, - QSP_API_URL + "/api/order/qcastQuotationSave", estimateSendRequest); + QSP_API_URL + "/api/order/qcastQuotationSave", estimateSendRequest); if (!"".equals(strResponse)) { com.fasterxml.jackson.databind.ObjectMapper om = - new com.fasterxml.jackson.databind.ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + new com.fasterxml.jackson.databind.ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); response = om.readValue(strResponse, EstimateApiResponse.class); Map result = (Map) response.getData(); if (result != null) { List> succList = - (List>) result.get("successList"); + (List>) result.get("successList"); for (Map succ : succList) { if (succ != null) { for (EstimateSendResponse data : quoteList) { if (data.getObjectNo().equals(succ.get("objectNo")) - && data.getPlanNo().equals(succ.get("planNo"))) { + && data.getPlanNo().equals(succ.get("planNo"))) { data.setSyncFlg(String.valueOf(succ.get("syncFlg"))); data.setDocNo(String.valueOf(succ.get("docNo"))); } @@ -1830,7 +1822,7 @@ public class EstimateService { * @throws QcastException */ public Document estimatePdfHtml(Document doc, EstimateResponse data, List list) - throws IOException, QcastException { + throws IOException, QcastException { Element elm; @@ -1852,7 +1844,7 @@ public class EstimateService { elm = doc.getElementById("objectNo1"); elm.text(StringUtils.defaultString(data.getObjectNo()) + " / " - + StringUtils.defaultString(data.getPlanNo())); + + StringUtils.defaultString(data.getPlanNo())); /* * elm = doc.getElementById("planNo"); elm.text(StringUtils.defaultString(data.getPlanNo())); @@ -1889,19 +1881,19 @@ public class EstimateService { for (ItemResponse itemResponse : list) { sb.append(""); sb.append( - "" + StringUtils.defaultString(itemResponse.getNo()) + ""); + "" + StringUtils.defaultString(itemResponse.getNo()) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getItemName()) + ""); + + StringUtils.defaultString(itemResponse.getItemName()) + ""); sb.append("" + StringUtils.defaultString(itemResponse.getItemNo()) - + ""); + + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getSalePrice()) + ""); + + StringUtils.defaultString(itemResponse.getSalePrice()) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getAmount()) + ""); + + StringUtils.defaultString(itemResponse.getAmount()) + ""); sb.append( - "" + StringUtils.defaultString(itemResponse.getUnit()) + ""); + "" + StringUtils.defaultString(itemResponse.getUnit()) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getSaleTotPrice()) + ""); + + StringUtils.defaultString(itemResponse.getSaleTotPrice()) + ""); sb.append(""); } if ("Y".equals(data.getPkgYn())) { @@ -1910,12 +1902,12 @@ public class EstimateService { sb.append("住宅 PKG"); sb.append("-"); sb.append("" - + StringUtils.defaultString(data.getPkgAsp()) + ""); + + StringUtils.defaultString(data.getPkgAsp()) + ""); sb.append("" - + StringUtils.defaultString(data.getTotVol()) + ""); + + StringUtils.defaultString(data.getTotVol()) + ""); sb.append("W"); sb.append("" - + StringUtils.defaultString(data.getPkgTotPrice()) + ""); + + StringUtils.defaultString(data.getPkgTotPrice()) + ""); sb.append(""); } elm = doc.getElementById("itemList_detail"); @@ -1944,9 +1936,9 @@ public class EstimateService { for (NoteResponse noteResponse : data.getNoteList()) { sb.append(""); sb.append("" - + StringUtils.defaultString(noteResponse.getCodeNm()) + ""); + + StringUtils.defaultString(noteResponse.getCodeNm()) + ""); sb.append("" + StringUtils - .defaultString(noteResponse.getRemarks()).replaceAll("\r\n|\r|\n", "
") + ""); + .defaultString(noteResponse.getRemarks()).replaceAll("\r\n|\r|\n", "
") + ""); sb.append(""); } elm = doc.getElementById("noteList_detail"); @@ -1956,7 +1948,7 @@ public class EstimateService { // 도면 설정 elm = doc.getElementById("objectNo4"); elm.text(StringUtils.defaultString(data.getObjectNo()) + " (Plan No : " - + StringUtils.defaultString(data.getPlanNo()) + ")"); + + StringUtils.defaultString(data.getPlanNo()) + ")"); elm = doc.getElementById("objectName"); elm.text(StringUtils.defaultString(data.getObjectName())); @@ -1996,9 +1988,9 @@ public class EstimateService { sb.append(""); sb.append("" + (no++) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getItemNo()) + ""); + + StringUtils.defaultString(itemResponse.getItemNo()) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getAmount()) + ""); + + StringUtils.defaultString(itemResponse.getAmount()) + ""); sb.append(""); } } @@ -2012,8 +2004,8 @@ public class EstimateService { sb.append(""); sb.append("" + (no++) + ""); sb.append( - "" + StringUtils.defaultString(itemResponse.getItemNo()) - + " [" + itemResponse.getCircuitCfg() + "]" + ""); + "" + StringUtils.defaultString(itemResponse.getItemNo()) + + " [" + itemResponse.getCircuitCfg() + "]" + ""); sb.append(""); } elm = doc.getElementById("pcsItemList_detail"); @@ -2028,7 +2020,7 @@ public class EstimateService { sb.append("" + StringUtils.defaultString(roofResponse.getClassTypeName()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getAmount()) + ""); sb.append("" - + StringUtils.defaultString(roofResponse.getVolKw()) + ""); + + StringUtils.defaultString(roofResponse.getVolKw()) + ""); sb.append(""); } elm = doc.getElementById("surFaceList_detail"); @@ -2047,12 +2039,12 @@ public class EstimateService { sb.append(""); sb.append("" + StringUtils.defaultString(roofResponse.getRoofSurface()) + ""); sb.append("" - + StringUtils.defaultString(roofResponse.getRoofMaterialName()) + ""); + + StringUtils.defaultString(roofResponse.getRoofMaterialName()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getSlope()) + "寸"); sb.append("" + StringUtils.defaultString(roofResponse.getConstructSpecificationName()) - + ""); + + ""); sb.append("" - + StringUtils.defaultString(roofResponse.getSupportMethodName()) + ""); + + StringUtils.defaultString(roofResponse.getSupportMethodName()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getSurfaceType()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getSetupHeight()) + ""); sb.append(""); @@ -2063,7 +2055,7 @@ public class EstimateService { elm = doc.getElementById("objectNo5"); elm.text(StringUtils.defaultString(data.getObjectNo()) + " (Plan No : " - + StringUtils.defaultString(data.getPlanNo()) + ")"); + + StringUtils.defaultString(data.getPlanNo()) + ")"); elm = doc.getElementById("objectName5"); elm.text(StringUtils.defaultString(data.getObjectName())); @@ -2103,9 +2095,9 @@ public class EstimateService { sb.append(""); sb.append("" + (no++) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getItemNo()) + ""); + + StringUtils.defaultString(itemResponse.getItemNo()) + ""); sb.append("" - + StringUtils.defaultString(itemResponse.getAmount()) + ""); + + StringUtils.defaultString(itemResponse.getAmount()) + ""); sb.append(""); } } @@ -2118,12 +2110,12 @@ public class EstimateService { sb.append(""); sb.append("" + StringUtils.defaultString(roofResponse.getRoofSurface()) + ""); sb.append("" - + StringUtils.defaultString(roofResponse.getRoofMaterialName()) + ""); + + StringUtils.defaultString(roofResponse.getRoofMaterialName()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getSlope()) + "寸"); sb.append("" + StringUtils.defaultString(roofResponse.getConstructSpecificationName()) - + ""); + + ""); sb.append("" - + StringUtils.defaultString(roofResponse.getSupportMethodName()) + ""); + + StringUtils.defaultString(roofResponse.getSupportMethodName()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getSurfaceType()) + ""); sb.append("" + StringUtils.defaultString(roofResponse.getSetupHeight()) + ""); sb.append(""); @@ -2164,7 +2156,7 @@ public class EstimateService { // 견적서 동기화 실패 목록 조회 List estimateSendListResponse = - estimateMapper.selectEstimateApiFailList(); + estimateMapper.selectEstimateApiFailList(); for (EstimateSendResponse estimateSendResponse : estimateSendListResponse) { EstimateRequest estimateRequest = new EstimateRequest(); @@ -2172,12 +2164,12 @@ public class EstimateService { estimateRequest.setPlanNo(estimateSendResponse.getPlanNo()); String constructSpecification = - estimateMapper.selectEstimateConstructSpecification(estimateRequest); + estimateMapper.selectEstimateConstructSpecification(estimateRequest); estimateSendResponse.setSaveType("3"); estimateSendResponse.setSyncFlg("0"); estimateSendResponse.setConstructSpecification( - !StringUtils.isEmpty(constructSpecification) ? constructSpecification : ""); + !StringUtils.isEmpty(constructSpecification) ? constructSpecification : ""); estimateSendResponse.setDelFlg("1".equals(estimateSendResponse.getDelFlg()) ? "Y" : "N"); // 아이템 목록 조회 @@ -2232,13 +2224,13 @@ public class EstimateService { * @return */ private List getPcsCircuitList(List pcsItemList, - List moduleList) { + List moduleList) { if (pcsItemList != null && pcsItemList.size() > 0) { for (ItemRequest itemRequest : moduleList) { itemRequest - .setCircuit(itemRequest.getCircuit().replaceAll("\\(", "").replaceAll("\\)", "")); + .setCircuit(itemRequest.getCircuit().replaceAll("\\(", "").replaceAll("\\)", "")); } if (pcsItemList.size() == 1) { @@ -2250,8 +2242,8 @@ public class EstimateService { String val = String.valueOf(j); List resultList = moduleList.stream() - .filter(t -> StringUtils.equals(val, t.getCircuit().split("-")[0])) - .collect(Collectors.toList()); + .filter(t -> StringUtils.equals(val, t.getCircuit().split("-")[0])) + .collect(Collectors.toList()); data.setCircuitCfg(this.getPcsCircuitCtg(resultList)); j++; } @@ -2307,7 +2299,7 @@ public class EstimateService { if (StringUtils.isEmpty(priceRequest.getSapSalesStoreCd())) { throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Sap Sale Store Code")); + message.getMessage("common.message.required.data", "Sap Sale Store Code")); } @@ -2315,15 +2307,15 @@ public class EstimateService { /* [1]. QSP API (url + param) Setting */ String url = QSP_API_URL + "/api/master/agencyCustList"; String apiUrl = UriComponentsBuilder.fromHttpUrl(url) - .queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd()).build().toUriString(); + .queryParam("sapSalesStoreCd", priceRequest.getSapSalesStoreCd()).build().toUriString(); /* [2]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); if (!"".equals(strResponse)) { com.fasterxml.jackson.databind.ObjectMapper om = - new com.fasterxml.jackson.databind.ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + new com.fasterxml.jackson.databind.ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); response = om.readValue(strResponse, EstimateApiResponse.class); } else { // [msg] No data