From a65822125911a45e1e3e139af7ca5d9d91bc02a4 Mon Sep 17 00:00:00 2001 From: ysCha Date: Fri, 5 Jun 2026 16:39:06 +0900 Subject: [PATCH] =?UTF-8?q?[2254]=20=E8=AA=8D=E5=AE=9A=E5=AE=B9=E9=87=8F?= =?UTF-8?q?=20FLOAT=20=EC=9E=94=EC=97=AC=20=EC=9B=90=EC=B2=9C=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8=20=E2=80=94=20SQL=20W=20=ED=95=A9=EB=A7=8C=20?= =?UTF-8?q?=EB=B0=98=ED=99=98,=20kW=20=EB=B3=80=ED=99=98=EC=9D=80=20Java?= =?UTF-8?q?=20BigDecimal(=EB=AA=A8=EB=93=88=EC=9A=A9=EB=9F=89=20=EB=8F=99?= =?UTF-8?q?=EC=9D=BC=20=EC=A0=95=EC=B1=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/interplug/qcast/biz/estimate/EstimateService.java | 7 ++++++- src/main/resources/mappers/estimate/estimateMapper.xml | 5 ++--- 2 files changed, 8 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 66a2d928..177ca8a6 100644 --- a/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java +++ b/src/main/java/com/interplug/qcast/biz/estimate/EstimateService.java @@ -1447,7 +1447,12 @@ public class EstimateService { roofInfoResponse.setRoofVolList(roofVolList); // 인증용량 구하기 (지붕면마다 모듈과 각각의 PCS의 총 용량을 서로 비교해 낮은쪽 용량으로 합산) - roofInfoResponse.setCertVolKw(estimateMapper.selectEstimateRoofCertVolKw(estimateRequest)); + // 2026-06-05: SQL 은 W 합만 반환. kW 변환·3자리 절사(FLOOR)는 모듈용량(totVolKw)과 동일하게 처리 — FLOAT 나눗셈 잔여 방지 + String certVolW = estimateMapper.selectEstimateRoofCertVolKw(estimateRequest); + roofInfoResponse.setCertVolKw(String.valueOf( + new BigDecimal(StringUtils.isEmpty(certVolW) ? "0" : certVolW) + .multiply(new BigDecimal("0.001")) + .setScale(3, RoundingMode.FLOOR))); //방위값 CanvasPopupStatus cps = canvasPopupStatusService.selectCanvasPopupStatus(estimateResponse.getObjectNo(), Integer.parseInt(estimateResponse.getPlanNo()), "1"); diff --git a/src/main/resources/mappers/estimate/estimateMapper.xml b/src/main/resources/mappers/estimate/estimateMapper.xml index 8d08a4a1..9bc582ef 100644 --- a/src/main/resources/mappers/estimate/estimateMapper.xml +++ b/src/main/resources/mappers/estimate/estimateMapper.xml @@ -466,9 +466,8 @@ GROUP BY CIRCUIT_NO, CIRCUIT_ITEM_ID, CIRCUIT_CFG, CIRCUIT_SUM, PNOW_W ) - -- 2026-05-22: FLOAT ROUND 결과의 IEEE754 잔여(예: 5.5600000000000005) 차단 위해 DECIMAL 캐스팅 - -- 2026-06-02: モジュール容量(totVolKw, setScale(3,FLOOR))과 동일 표시 위해 3자리 절사 + DECIMAL(18,3) 마감 (ROUND 3번째 인자=1 → 절사) - SELECT CAST(ROUND((SUM(MIN_VALUE) / 1000), 3, 1) AS DECIMAL(18,3)) AS CERT_VOL_KW + -- 2026-06-05: SQL 은 W 합만 DECIMAL 로 정확히 반환. kW 변환·3자리 절사(FLOOR)는 모듈용량(totVolKw)과 동일하게 Java BigDecimal 에서 수행 → FLOAT 나눗셈 잔여(5.6899999999999995 / 5.339) 원천 차단 + SELECT CAST(SUM(MIN_VALUE) AS DECIMAL(18,3)) AS CERT_VOL_W FROM CIRCUIT_AGG ]]> -- 2.47.2