Q.CAST > Q.ORDER 시공타입 우선 선정 기능 개발

This commit is contained in:
LAPTOP-L3VE7KK2\USER 2025-02-13 18:07:16 +09:00
parent 928a8be6a5
commit 461f399fc4
3 changed files with 32 additions and 6 deletions

View File

@ -122,4 +122,7 @@ public interface EstimateMapper {
// Plan 확정 동기화
public int updatePlanConfirmSync(PlanSyncResponse planSyncData);
// 견적서 Q.ORDER 연동 시공타입 조회
public String selectEstimateConstructSpecification(EstimateRequest estimateRequest);
}

View File

@ -1709,12 +1709,13 @@ public class EstimateService {
if (estimateSendResponse == null) {
throw new QcastException(ErrorCode.NOT_FOUND, message.getMessage("common.message.no.data"));
} else {
String constructSpecification =
estimateMapper.selectEstimateConstructSpecification(estimateRequest);
estimateSendResponse.setSaveType("3");
estimateSendResponse.setSyncFlg("0");
estimateSendResponse.setConstructSpecification(
!StringUtils.isEmpty(estimateSendResponse.getConstructSpecification())
? estimateSendResponse.getConstructSpecification().split("")[0]
: "");
!StringUtils.isEmpty(constructSpecification) ? constructSpecification : "");
estimateSendResponse.setDelFlg("1".equals(estimateSendResponse.getDelFlg()) ? "Y" : "N");
// 아이템 목록 조회
@ -2182,12 +2183,13 @@ public class EstimateService {
estimateRequest.setObjectNo(estimateSendResponse.getObjectNo());
estimateRequest.setPlanNo(estimateSendResponse.getPlanNo());
String constructSpecification =
estimateMapper.selectEstimateConstructSpecification(estimateRequest);
estimateSendResponse.setSaveType("3");
estimateSendResponse.setSyncFlg("0");
estimateSendResponse.setConstructSpecification(
!StringUtils.isEmpty(estimateSendResponse.getConstructSpecification())
? estimateSendResponse.getConstructSpecification().split("")[0]
: "");
!StringUtils.isEmpty(constructSpecification) ? constructSpecification : "");
estimateSendResponse.setDelFlg("1".equals(estimateSendResponse.getDelFlg()) ? "Y" : "N");
// 아이템 목록 조회

View File

@ -1205,4 +1205,25 @@
AND PLAN_NO = #{planNo}
</update>
<select id="selectEstimateConstructSpecification" parameterType="com.interplug.qcast.biz.estimate.dto.EstimateRequest" resultType="String">
/* sqlid : com.interplug.qcast.biz.estimate.selectEstimateConstructSpecification */
SELECT
TOP 1
T.CONSTRUCT_SPECIFICATION
FROM (
SELECT
PRE.CONSTRUCT_SPECIFICATION
, CASE WHEN LEFT(PRE.ROOF_SURFACE, 1) = '南' THEN 1
WHEN LEFT(PRE.ROOF_SURFACE, 1) = '東' THEN 2
WHEN LEFT(PRE.ROOF_SURFACE, 1) = '西' THEN 3
WHEN LEFT(PRE.ROOF_SURFACE, 1) = '北' THEN 4
ELSE 5 END ROOF_SURFACE_NUM
, (SELECT ISNULL(SUM(AMOUNT), 0) FROM T_PART_ROOF_ITEM_ESTIMATE WHERE ROOF_SURFACE_ID = PRE.ROOF_SURFACE_ID AND OBJECT_NO = PRE.OBJECT_NO AND PLAN_NO = PRE.PLAN_NO) AS MODULE_TCNT
FROM T_PART_ROOF_ESTIMATE PRE WITH (NOLOCK)
WHERE PRE.OBJECT_NO = #{objectNo}
AND PRE.PLAN_NO = #{planNo}
) T
ORDER BY T.MODULE_TCNT DESC, T.ROOF_SURFACE_NUM ASC
</select>
</mapper>