[1226] 새로고침 지붕재 리셋 하제비치

This commit is contained in:
ysCha 2025-08-04 11:35:35 +09:00
parent 7c378ae369
commit e1e4c52264
5 changed files with 75 additions and 2 deletions

View File

@ -41,5 +41,7 @@ public interface CanvasBasicSettingMapper {
// Canvas 지붕재추가 Setting 삭제
public void deleteRoofMaterialsAdd(String objectNo, Integer planNo);
// Canvas 하제비치 update
public void updateHajebichRoofMaterialsAdd(CanvasBasicSettingResponse canvasBasicSettingResponse);
}

View File

@ -1,18 +1,29 @@
package com.interplug.qcast.biz.canvaspopupstatus;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.interplug.qcast.biz.canvasBasicSetting.CanvasBasicSettingMapper;
import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse;
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
import com.interplug.qcast.biz.estimate.dto.EstimateApiResponse;
import com.interplug.qcast.config.Exception.ErrorCode;
import com.interplug.qcast.config.Exception.QcastException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class CanvasPopupStatusService {
private final CanvasPopupStatusMapper canvasPopupStatusMapper;
private final CanvasBasicSettingMapper canvasBasicSettingMapper;
/**
* Canvas Popup Status 조회
@ -44,6 +55,53 @@ public class CanvasPopupStatusService {
} else {
updateCanvasPopupStatus(cps);
}
//기초정보 업데이트 (roofHajebichi)
String hajebichi = cps.getHajebichi();
if(hajebichi != null && !hajebichi.isEmpty()){
CanvasBasicSettingResponse canvasBasicSettingResponse = new CanvasBasicSettingResponse();
canvasBasicSettingResponse.setObjectNo(cps.getObjectNo());
canvasBasicSettingResponse.setPlanNo(cps.getPlanNo());
canvasBasicSettingResponse.setRoofHajebichi(Integer.valueOf(hajebichi));
canvasBasicSettingMapper.updateHajebichRoofMaterialsAdd(canvasBasicSettingResponse);
}
// String popupStatus = cps.getPopupStatus();
// List<Integer> hajebichiList = new ArrayList<>();//getHajebichiValues(popupStatus, 0, 1); // roofIndex=0, planNo=1인 hajebichi 값들 조회
//
// try {
// ObjectMapper mapper = new ObjectMapper();
// JsonNode rootNode = mapper.readTree(popupStatus);
// JsonNode roofConstructions = rootNode.get("roofConstructions");
// if (roofConstructions.isArray()) {
// for (JsonNode construction : roofConstructions) {
// JsonNode addRoof = construction.get("addRoof");
// if (addRoof != null
// && addRoof.get("roofIndex").asInt() == 0
// && addRoof.get("planNo").asInt() == cps.getPlanNo()) {
// hajebichiList.add(addRoof.get("hajebichi").asInt());
// }
// }
// }
//
// } catch (JsonProcessingException e) {
// throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, "JSON 파싱 오류");
// }
// if(!hajebichiList.isEmpty()){
// CanvasBasicSettingResponse canvasBasicSettingResponse = new CanvasBasicSettingResponse();
// canvasBasicSettingResponse.setObjectNo(cps.getObjectNo());
// canvasBasicSettingResponse.setPlanNo(cps.getPlanNo());
// canvasBasicSettingResponse.setRoofHajebichi(hajebichiList.get(0));
//
// if(canvasBasicSettingResponse.getRoofHajebichi() > 0){
// canvasBasicSettingMapper.updateHajebichRoofMaterialsAdd(canvasBasicSettingResponse);
// }
//
// }
}
/**

View File

@ -25,4 +25,8 @@ public class CanvasPopupStatus {
@Schema(description = "캔버스 팝업 상태 데이터")
private String popupStatus;
@Schema(description = "하제비치")
private String hajebichi;
}

View File

@ -227,4 +227,12 @@
AND plan_no = #{planNo}
</delete>
<update id="updateHajebichRoofMaterialsAdd" parameterType="com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse">
/* sqlid : updateHajebichRoofMaterialsAdd */
UPDATE TB_CANVAS_ROOF_MATERIALS_ADD
SET roof_hajebichi = #{roofHajebichi}
WHERE object_no = #{objectNo}
AND plan_no = #{planNo}
</update>
</mapper>

View File

@ -11,7 +11,8 @@
object_no,
plan_no,
popup_type,
popup_status
popup_status,
#{hajebichi} AS hajebichi
FROM T_CANVAS_POPUP_STATUS
WHERE object_no = #{objectNo}
AND plan_no = #{planNo}